canvas_sync 0.17.5 → 0.17.6.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/canvas_sync/job_batches/batch.rb +39 -1
- data/lib/canvas_sync/job_batches/pool.rb +31 -1
- data/lib/canvas_sync/version.rb +1 -1
- data/spec/dummy/log/test.log +7544 -0
- data/spec/job_batching/batch_spec.rb +28 -0
- metadata +4 -4
@@ -227,6 +227,34 @@ RSpec.describe CanvasSync::JobBatches::Batch do
|
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
230
|
+
it 'delays triggering callbacks if keep_open is set' do
|
231
|
+
ActiveJob::Base.queue_adapter = :sidekiq
|
232
|
+
CanvasSync::JobBatches::Batch::Callback.worker_class = CanvasSync::JobBatches::Sidekiq::SidekiqCallbackWorker
|
233
|
+
|
234
|
+
callback_instance = double('SampleCallback')
|
235
|
+
expect(SampleCallback).to receive(:new).at_least(1).times.and_return(callback_instance)
|
236
|
+
expect(callback_instance).not_to receive(:on_complete)
|
237
|
+
expect(callback_instance).not_to receive(:on_success)
|
238
|
+
|
239
|
+
batch.on(:complete, SampleCallback)
|
240
|
+
batch.on(:success, SampleCallback)
|
241
|
+
batch.keep_open!
|
242
|
+
|
243
|
+
Sidekiq::Testing.inline! do
|
244
|
+
CanvasSync::JobBatches::Batch.process_failed_job(bid, jid)
|
245
|
+
CanvasSync::JobBatches::Batch.process_successful_job(bid, jid)
|
246
|
+
end
|
247
|
+
|
248
|
+
RSpec::Mocks.space.proxy_for(callback_instance).reset
|
249
|
+
|
250
|
+
expect(callback_instance).to receive(:on_complete)
|
251
|
+
expect(callback_instance).to receive(:on_success)
|
252
|
+
|
253
|
+
Sidekiq::Testing.inline! do
|
254
|
+
batch.let_close!
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
230
258
|
it 'triggers callbacks as expected' do
|
231
259
|
ActiveJob::Base.queue_adapter = :sidekiq
|
232
260
|
CanvasSync::JobBatches::Batch.redis { |r| r.hset("BID-#{bid}", 'pending', 0) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: canvas_sync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.6.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nate Collings
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -644,9 +644,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
644
644
|
version: '0'
|
645
645
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
646
646
|
requirements:
|
647
|
-
- - "
|
647
|
+
- - ">"
|
648
648
|
- !ruby/object:Gem::Version
|
649
|
-
version:
|
649
|
+
version: 1.3.1
|
650
650
|
requirements: []
|
651
651
|
rubygems_version: 3.0.3
|
652
652
|
signing_key:
|