sunspot_offline 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sunspot_offline.rb +5 -0
- data/lib/sunspot_offline/rsolr/client.rb +1 -1
- data/lib/sunspot_offline/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c2d171a793b842f3a804ab98b3337620f8c34ea167b26f5583a9b154daa4290
|
4
|
+
data.tar.gz: c11e65822982b822aead56e132dbad74036fb93c2795db17e11405c2768db279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc8195afc8f935bab36932ecef51d44ed1ba4c2e18144b5804e1ffb469e52e7a0707e9bb8f257b0d0143eb79f0a40123da12e2d76ab0d815f332063979838604
|
7
|
+
data.tar.gz: f63614159f82463c181e420c62902073dfcaedb2f0ee491c70ea50f473902eb665b6bc2698eb78b6da768aafad80456bfab8c1a519608e11b937a906d8eb90d1
|
data/lib/sunspot_offline.rb
CHANGED
@@ -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
|
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.
|
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:
|
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:
|
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:
|
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
|
-
|
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
|