inst-jobs 3.0.0 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a9b37f7e43ec441a00056cbacce6f749e93de4496f4cbdff2c765015056ac71
4
- data.tar.gz: ccbb0ed96932e436e109db2ae5c3076ce64245bc98a04424f5f9858f045d7a81
3
+ metadata.gz: c9d86b7b6161b9397c885a82d687f85d84e7a17db5261bfc5ef1bb7e9f25e2ac
4
+ data.tar.gz: 4a75f8ac73b5f0a0b19d8073bcbfe87f654bbbdb90e147ddf02066916653d4e0
5
5
  SHA512:
6
- metadata.gz: 560e60386a4ea4e2851b3c6304ab38982134be7141c6d84671259f744c1d1fbb2dbb7af099ecbe2606fe35364b0d20dd54a6a6dccc6cea95ed02dc56c840d8d7
7
- data.tar.gz: 9aceb6dc65083dc71a7f360d6a7e3fafbb8992f17b9a080e53e190d5a7772b417ef7caecd05f3c6f9fe8462e7ea9f67f788e9423d45dd251979547e3329924a0
6
+ metadata.gz: cd3f9df169146f34f7366e02830575bf27e2fd33e97d190bed34dd8be44e34431261111eef133368cd342668cabeb529af6e16c8985fcf15c99807ea7a07fbab
7
+ data.tar.gz: 3924f7b2f6f4eee37c4d92bfedfd683304dfd0c035a65f47ea9dae607c0e81b03c35860420f39a7dadf890d203c85fe24de68c90c80a48839f23b6193311b3e3
@@ -176,7 +176,9 @@ module Delayed
176
176
  ignores = []
177
177
  loop do
178
178
  batch_scope = ignores.empty? ? jobs : jobs.where.not(id: ignores)
179
- batch = batch_scope.to_a
179
+ # if we don't reload this it's possible to keep getting the
180
+ # same array each loop even after the jobs have been deleted.
181
+ batch = batch_scope.reload.to_a
180
182
  break if batch.empty?
181
183
 
182
184
  batch.each do |job|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Delayed
4
- VERSION = "3.0.0"
4
+ VERSION = "3.0.1"
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "timeout"
4
+
3
5
  module InDelayedJobTest
4
6
  def self.check_in_job
5
7
  Delayed::Job.in_delayed_job?.should == true
@@ -960,6 +962,21 @@ shared_examples_for "a backend" do
960
962
  end
961
963
  end
962
964
 
965
+ it "removes an un-reschedulable job" do
966
+ change_setting(Delayed::Settings, :max_attempts, -1) do
967
+ job = Delayed::Job.new(tag: "tag")
968
+ `echo ''`
969
+ child_pid = $?.pid
970
+ job.create_and_lock!("Jobworker:#{child_pid}")
971
+ Timeout.timeout(1) do
972
+ # if this takes longer than a second it's hung
973
+ # in an infinite loop, which would be bad.
974
+ expect(Delayed::Job.unlock_orphaned_jobs(nil, "Jobworker")).to eq(1)
975
+ end
976
+ expect { Delayed::Job.find(job.id) }.to raise_error(ActiveRecord::RecordNotFound)
977
+ end
978
+ end
979
+
963
980
  it "unlocks orphaned jobs given a pid" do
964
981
  change_setting(Delayed::Settings, :max_attempts, 2) do
965
982
  job1 = Delayed::Job.new(tag: "tag")
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
- - Tobias Luetke
8
- - Brian Palmer
9
- autorequire:
7
+ - Cody Cutrer
8
+ - Ethan Vizitei
9
+ - Jacob Burroughs
10
+ autorequire:
10
11
  bindir: exe
11
12
  cert_chain: []
12
- date: 2021-09-30 00:00:00.000000000 Z
13
+ date: 2021-10-20 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activerecord
@@ -409,9 +410,11 @@ dependencies:
409
410
  - - "~>"
410
411
  - !ruby/object:Gem::Version
411
412
  version: 1.4.0
412
- description:
413
+ description:
413
414
  email:
414
- - brianp@instructure.com
415
+ - cody@instructure.com
416
+ - evizitei@instructure.com
417
+ - jburroughs@instructure.com
415
418
  executables:
416
419
  - inst_jobs
417
420
  extensions: []
@@ -513,7 +516,7 @@ files:
513
516
  homepage: https://github.com/instructure/inst-jobs
514
517
  licenses: []
515
518
  metadata: {}
516
- post_install_message:
519
+ post_install_message:
517
520
  rdoc_options: []
518
521
  require_paths:
519
522
  - lib
@@ -528,8 +531,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
528
531
  - !ruby/object:Gem::Version
529
532
  version: '0'
530
533
  requirements: []
531
- rubygems_version: 3.2.24
532
- signing_key:
534
+ rubygems_version: 3.0.3
535
+ signing_key:
533
536
  specification_version: 4
534
537
  summary: Instructure-maintained fork of delayed_job
535
538
  test_files: