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 +4 -4
- data/lib/delayed/backend/base.rb +3 -1
- data/lib/delayed/version.rb +1 -1
- data/spec/shared/shared_backend.rb +17 -0
- metadata +13 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9d86b7b6161b9397c885a82d687f85d84e7a17db5261bfc5ef1bb7e9f25e2ac
|
4
|
+
data.tar.gz: 4a75f8ac73b5f0a0b19d8073bcbfe87f654bbbdb90e147ddf02066916653d4e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd3f9df169146f34f7366e02830575bf27e2fd33e97d190bed34dd8be44e34431261111eef133368cd342668cabeb529af6e16c8985fcf15c99807ea7a07fbab
|
7
|
+
data.tar.gz: 3924f7b2f6f4eee37c4d92bfedfd683304dfd0c035a65f47ea9dae607c0e81b03c35860420f39a7dadf890d203c85fe24de68c90c80a48839f23b6193311b3e3
|
data/lib/delayed/backend/base.rb
CHANGED
@@ -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
|
-
|
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|
|
data/lib/delayed/version.rb
CHANGED
@@ -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.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
|
7
|
+
- Cody Cutrer
|
8
|
+
- Ethan Vizitei
|
9
|
+
- Jacob Burroughs
|
10
|
+
autorequire:
|
10
11
|
bindir: exe
|
11
12
|
cert_chain: []
|
12
|
-
date: 2021-
|
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
|
-
-
|
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.
|
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:
|