sunspot_offline 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95e239da7f8ca4ef06fd735cd14f021ffb02fb9651594c058d38f5c664a75a7e
4
- data.tar.gz: 4312f70c4f47f41f03a3465789ee3bb0f5a9b2a76ddba4b6434f9a13547790d7
3
+ metadata.gz: 4c2d171a793b842f3a804ab98b3337620f8c34ea167b26f5583a9b154daa4290
4
+ data.tar.gz: c11e65822982b822aead56e132dbad74036fb93c2795db17e11405c2768db279
5
5
  SHA512:
6
- metadata.gz: b673ece048a15fa3374ea0cdde78548ee8dfb7bb1a96a9b2abadf9512956cbbe8e23d119d44a832a80336bf46a4ad153093c703d2b3d8e254aad948e69053e58
7
- data.tar.gz: bd4c12927c0d77d408c1c84ddfb87b09258f4efca56840f2d5f491c5c7cec26caa9bdfbb0b6d04724b377240c4824cbb97f5d7d311c45cf5c9c16a5fab53e3ee
6
+ metadata.gz: dc8195afc8f935bab36932ecef51d44ed1ba4c2e18144b5804e1ffb469e52e7a0707e9bb8f257b0d0143eb79f0a40123da12e2d76ab0d815f332063979838604
7
+ data.tar.gz: f63614159f82463c181e420c62902073dfcaedb2f0ee491c70ea50f473902eb665b6bc2698eb78b6da768aafad80456bfab8c1a519608e11b937a906d8eb90d1
@@ -8,6 +8,7 @@ module SunspotOffline
8
8
  class << self
9
9
  def configuration
10
10
  @configuration ||= OpenStruct.new(
11
+ enabled: true,
11
12
  retry_delay: 1.hour,
12
13
  solr_error_callback: ->(_exception) {},
13
14
  filter_sidekiq_job_callback: ->(_job) { false }, # some Sidekiq jobs are allowed to fail and retry on their own
@@ -33,5 +34,9 @@ module SunspotOffline
33
34
  def filter_sidekiq_job?(job_class_name)
34
35
  configuration.filter_sidekiq_job_callback.call(job_class_name) if configuration.filter_sidekiq_job_callback
35
36
  end
37
+
38
+ def disabled?
39
+ !configuration.enabled
40
+ end
36
41
  end
37
42
  end
@@ -21,7 +21,7 @@ module SunspotOffline
21
21
  def wrap_request(deletion:, documents:)
22
22
  yield
23
23
  rescue StandardError => ex
24
- raise ex if raise_exception?
24
+ raise ex if SunspotOffline.disabled? || raise_exception?
25
25
 
26
26
  job = deletion ? SunspotOffline.configuration.removal_job : SunspotOffline.configuration.index_job
27
27
  perform_at = Time.zone.now + SunspotOffline.configuration.retry_delay
@@ -1,3 +1,3 @@
1
1
  module SunspotOffline
2
- VERSION = '0.1.2'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunspot_offline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Glukhov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-28 00:00:00.000000000 Z
11
+ date: 2019-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.3'
103
+ version: 1.3.6
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.3'
110
+ version: 1.3.6
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rails
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -204,8 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  requirements: []
207
- rubyforge_project:
208
- rubygems_version: 2.7.7
207
+ rubygems_version: 3.0.2
209
208
  signing_key:
210
209
  specification_version: 4
211
210
  summary: Simple failover method into your sunspot_rails + sidekiq setup