resque-durable 2.0.0 → 2.2.0

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: a514c11d6f3655311d22c6d055a243f5cc22a8ec26d7ade6880dd1a6c05ca000
4
- data.tar.gz: 5d005e32eeb791e0a4bae2a275f146eac208e6848f0cb013ce5bbd020168ad0e
3
+ metadata.gz: b1a9e256ca3afbc5a1605c176de59a028c2546c626f2845c2180bac51dc6b821
4
+ data.tar.gz: f55e471e1139d717ed4002aff1fc01bef8dfe52649c13a3ee0e5e9fd539237d2
5
5
  SHA512:
6
- metadata.gz: 62aeda110d3e195e18285692a57b4519be97ce777e8b2d8144b3ec21e356ec75173e55b9570961669c818791521af92b1117f93791915cbdb181465cee3eedae
7
- data.tar.gz: dbb59ca8dc5e86a31059625930028df2e6cd81535e715c39078c6599b2d5ee8c2cd3747cd7c82eac3c2ef60fdfb825119d8920ac9bc29a4aad024f1fac4b6e42
6
+ metadata.gz: de3d4efce9c67ea0dcfb7df3d2f19070c01463de09694135cf56b11fc7dcba5ab335412e3b5c8795e58b9a72e807c1277cde95a8250eb7ac8514d30c3bb641bc
7
+ data.tar.gz: bd6fdfc08faceed5a402a7e7c33f2e2997a82a66d6d4e228dcc3ba34d1ede7f74c890e710572a56ad2b6186436b00a1d8f423cf36771255c568ea9a443fdab5a
@@ -131,6 +131,13 @@ module Resque
131
131
  (enqueue_count ** 3).minutes
132
132
  end
133
133
 
134
+ def reset_backoff!(timeout_at = Time.now.utc)
135
+ # Set timeout_at = Time.now and enqueue_count = 1 so
136
+ # the job can be picked up by the Durable Monitor asap.
137
+ self.timeout_at = timeout_at
138
+ self.enqueue_count = 1
139
+ save!
140
+ end
134
141
  end
135
142
  end
136
143
  end
@@ -66,10 +66,24 @@ module Resque
66
66
  yield
67
67
  end
68
68
 
69
- a.complete!
69
+ if requeue_immediately
70
+ a.reset_backoff!
71
+ else
72
+ a.complete!
73
+ end
70
74
  else
71
75
  yield
72
76
  end
77
+ ensure
78
+ @requeue_immediately = false
79
+ end
80
+
81
+ def requeue_immediately
82
+ @requeue_immediately
83
+ end
84
+
85
+ def requeue_immediately!
86
+ @requeue_immediately = true
73
87
  end
74
88
 
75
89
  def build_audit(args)
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-durable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Chapweske
8
8
  - Ben Osheroff
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-01-21 00:00:00.000000000 Z
12
+ date: 2021-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -25,8 +25,8 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '4.2'
28
- description:
29
- email:
28
+ description:
29
+ email:
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
@@ -40,7 +40,7 @@ homepage: https://github.com/zendesk/resque-durable
40
40
  licenses:
41
41
  - MIT
42
42
  metadata: {}
43
- post_install_message:
43
+ post_install_message:
44
44
  rdoc_options: []
45
45
  require_paths:
46
46
  - lib
@@ -55,8 +55,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubygems_version: 3.0.3
59
- signing_key:
58
+ rubyforge_project:
59
+ rubygems_version: 2.7.6.2
60
+ signing_key:
60
61
  specification_version: 4
61
62
  summary: Resque queue backed by database audits, with automatic retry
62
63
  test_files: []