inst-jobs 0.12.3 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -210,6 +210,23 @@ shared_examples_for 'a backend' do
210
210
  @job.locked_by.should be_nil
211
211
  @job.locked_at.should be_nil
212
212
  end
213
+
214
+ it "clears locks from multiple jobs" do
215
+ job2 = create_job(:locked_by => 'worker', :locked_at => Delayed::Job.db_time_now)
216
+ Delayed::Job.unlock([@job, job2])
217
+ expect(@job.locked_at).to be_nil
218
+ expect(job2.locked_at).to be_nil
219
+ # make sure it was persisted, too
220
+ expect(Delayed::Job.find(@job.id).locked_at).to be_nil
221
+ end
222
+ end
223
+
224
+ describe "#transfer_lock" do
225
+ it "works" do
226
+ job = create_job(:locked_by => 'worker', :locked_at => Delayed::Job.db_time_now)
227
+ expect(job.transfer_lock!(from: 'worker', to: 'worker2')).to eq true
228
+ expect(Delayed::Job.find(job.id).locked_by).to eq 'worker2'
229
+ end
213
230
  end
214
231
 
215
232
  context "strands" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Luetke
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-18 00:00:00.000000000 Z
12
+ date: 2017-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: after_transaction_commit
@@ -313,6 +313,7 @@ files:
313
313
  - lib/delayed/job_tracking.rb
314
314
  - lib/delayed/lifecycle.rb
315
315
  - lib/delayed/log_tailer.rb
316
+ - lib/delayed/logging.rb
316
317
  - lib/delayed/message_sending.rb
317
318
  - lib/delayed/performable_method.rb
318
319
  - lib/delayed/periodic.rb
@@ -329,6 +330,8 @@ files:
329
330
  - lib/delayed/version.rb
330
331
  - lib/delayed/work_queue/in_process.rb
331
332
  - lib/delayed/work_queue/parent_process.rb
333
+ - lib/delayed/work_queue/parent_process/client.rb
334
+ - lib/delayed/work_queue/parent_process/server.rb
332
335
  - lib/delayed/worker.rb
333
336
  - lib/delayed/yaml_extensions.rb
334
337
  - lib/delayed_job.rb
@@ -339,6 +342,8 @@ files:
339
342
  - spec/delayed/server_spec.rb
340
343
  - spec/delayed/settings_spec.rb
341
344
  - spec/delayed/work_queue/in_process_spec.rb
345
+ - spec/delayed/work_queue/parent_process/client_spec.rb
346
+ - spec/delayed/work_queue/parent_process/server_spec.rb
342
347
  - spec/delayed/work_queue/parent_process_spec.rb
343
348
  - spec/delayed/worker_spec.rb
344
349
  - spec/gemfiles/42.gemfile
@@ -386,6 +391,8 @@ test_files:
386
391
  - spec/delayed/server_spec.rb
387
392
  - spec/delayed/settings_spec.rb
388
393
  - spec/delayed/work_queue/in_process_spec.rb
394
+ - spec/delayed/work_queue/parent_process/client_spec.rb
395
+ - spec/delayed/work_queue/parent_process/server_spec.rb
389
396
  - spec/delayed/work_queue/parent_process_spec.rb
390
397
  - spec/delayed/worker_spec.rb
391
398
  - spec/gemfiles/42.gemfile