sidekiq-unique-jobs 7.1.21 → 7.1.24

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sidekiq-unique-jobs might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a009df15de36d139adf211d9c4cd96fe42e8bdfd243831dc7d4f64bc4f98cd56
4
- data.tar.gz: 767f9e88f3ca9fe563d34243ee98c1bc6dcb9852575b0e62153a66b213fef50a
3
+ metadata.gz: 1cfc4a33d7d14fc257c4a2e316950196f88687d479032840519b1b7a6aa21410
4
+ data.tar.gz: b2cd8fb056319d11250da89aa0e03c80151019ca54592bf6c426fe36c779f9c7
5
5
  SHA512:
6
- metadata.gz: c5c4d0e50fea0faac52c9183db15db1121af9e2839996e5593b4404d1cc5d1c50bee60e574d2538149a5a5fbe2832296041524f175a42859d239b1b8fe049165
7
- data.tar.gz: df0259ed2f86592b941a1e966926c21f071e2d1bc059379c68270b5878504a118108336be836fb28a4ba6380f1d44a1da890d45c5df8b7dfabede27b49d90105
6
+ metadata.gz: fe97fddbd710c1b6af36a814029cd8576b73e3f442222006644deb5651d264bb30f7336083ed5a649763e78e87df2fba807be3700501902b6559e8f8935a06fa
7
+ data.tar.gz: 6725f6c10ec85f0591d431ca2ff4f2b498c4fd309615c5ab3970fba1429f07676c98373dc6794f40fdc5ec8a646b54679c9b341c20d9a0f180fde0d86f9989ba
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## [v7.1.23](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.23) (2022-05-23)
4
+
5
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.22...v7.1.23)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - fix: raise on error [\#712](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/712) ([mhenrixon](https://github.com/mhenrixon))
10
+
11
+ ## [v7.1.22](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.22) (2022-05-04)
12
+
13
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.21...v7.1.22)
14
+
15
+ **Fixed bugs:**
16
+
17
+ - Failed jobs waiting to be retried are not considered when fetching uniqueness [\#394](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/394)
18
+ - fix\(locksmith\): execute to yield without arguments [\#710](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/710) ([mhenrixon](https://github.com/mhenrixon))
19
+ - fix: re:lock until\_executing on worker failure [\#709](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/709) ([mhenrixon](https://github.com/mhenrixon))
20
+
21
+ **Closed issues:**
22
+
23
+ - Reviwing: Failed jobs waiting to be retried are not considered when fetching uniqueness [\#708](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/708)
24
+
25
+ ## [v7.1.21](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.21) (2022-04-23)
26
+
27
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.20...v7.1.21)
28
+
29
+ **Implemented enhancements:**
30
+
31
+ - Prepare for Sidekiq v7 [\#707](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/707) ([mhenrixon](https://github.com/mhenrixon))
32
+
33
+ **Closed issues:**
34
+
35
+ - DEPRECATION WARNING: default\_worker\_options is deprecated and will be removed from Sidekiq 7.0 \(use default\_job\_options instead\) \(called from notify\_agents at /Users/hackeron/Development/Tether/timeline/app/models/user.rb:303\) [\#705](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/705)
36
+
3
37
  ## [v7.1.20](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.20) (2022-04-22)
4
38
 
5
39
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.19...v7.1.20)
@@ -395,7 +429,6 @@
395
429
  - Tasks run once, and then there is no launch [\#464](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/464)
396
430
  - Jobs executing and immediately returning [\#418](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/418)
397
431
  - until\_and\_while\_executing + sidekiq retry mechanism [\#395](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/395)
398
- - Failed jobs waiting to be retried are not considered when fetching uniqueness [\#394](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/394)
399
432
  - Fix that :PRIMED keys are seemingly not removed [\#574](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/574) ([mhenrixon](https://github.com/mhenrixon))
400
433
 
401
434
  **Closed issues:**
@@ -33,6 +33,10 @@ module SidekiqUniqueJobs
33
33
  def execute
34
34
  callback_safely if locksmith.unlock
35
35
  yield
36
+ rescue StandardError => ex
37
+ reflect(:execution_failed, item, ex)
38
+ locksmith.lock(wait: 1)
39
+ raise
36
40
  end
37
41
  end
38
42
  end
@@ -188,18 +188,18 @@ module SidekiqUniqueJobs
188
188
  # @yieldparam [string] job_id the sidekiq JID
189
189
  # @yieldreturn [void] whatever the calling block returns
190
190
  def lock!(conn, primed_method, wait = nil)
191
- return yield job_id if locked?(conn)
191
+ return yield if locked?(conn)
192
192
 
193
193
  enqueue(conn) do |queued_jid|
194
- reflect(:debug, item, queued_jid)
194
+ reflect(:debug, :queued, item, queued_jid)
195
195
 
196
196
  primed_method.call(conn, wait) do |primed_jid|
197
197
  reflect(:debug, :primed, item, primed_jid)
198
-
199
198
  locked_jid = call_script(:lock, key.to_a, argv, conn)
199
+
200
200
  if locked_jid
201
201
  reflect(:debug, :locked, item, locked_jid)
202
- return yield job_id
202
+ return yield
203
203
  end
204
204
  end
205
205
  end
@@ -6,6 +6,8 @@ module SidekiqUniqueJobs
6
6
  #
7
7
  # @author Mikael Henriksson <mikael@mhenrixon.com>
8
8
  class Client
9
+ include Sidekiq::ClientMiddleware if defined?(Sidekiq::ClientMiddleware)
10
+
9
11
  # prepend "SidekiqUniqueJobs::Middleware"
10
12
  # @!parse prepends SidekiqUniqueJobs::Middleware
11
13
  prepend SidekiqUniqueJobs::Middleware
@@ -6,6 +6,8 @@ module SidekiqUniqueJobs
6
6
  #
7
7
  # @author Mikael Henriksson <mikael@mhenrixon.com>
8
8
  class Server
9
+ include Sidekiq::ClientMiddleware if defined?(Sidekiq::ServerMiddleware)
10
+
9
11
  # prepend "SidekiqUniqueJobs::Middleware"
10
12
  # @!parse prepends SidekiqUniqueJobs::Middleware
11
13
  prepend SidekiqUniqueJobs::Middleware
@@ -71,18 +71,6 @@ module Sidekiq
71
71
 
72
72
  sidekiq_options(old_options)
73
73
  end
74
-
75
- #
76
- # Clears the jobs for this worker and removes all locks
77
- #
78
- def clear
79
- jobs.each do |job|
80
- SidekiqUniqueJobs::Unlockable.unlock(job)
81
- end
82
-
83
- Sidekiq::Queues[queue].clear
84
- jobs.clear
85
- end
86
74
  end
87
75
 
88
76
  #
@@ -110,8 +98,31 @@ module Sidekiq
110
98
 
111
99
  SidekiqUniqueJobs::Digests.new.delete_by_pattern("*", count: 10_000)
112
100
  end
101
+
102
+ #
103
+ # Prepends deletion of locks to clear
104
+ #
105
+ module ClassMethods
106
+ #
107
+ # Clears the jobs for this worker and removes all locks
108
+ #
109
+ def clear
110
+ jobs.each do |job|
111
+ SidekiqUniqueJobs::Unlockable.unlock(job)
112
+ end
113
+
114
+ super
115
+ end
116
+ end
113
117
  end
114
118
 
115
119
  prepend Overrides
120
+
121
+ #
122
+ # Prepends methods to Sidekiq::Worker
123
+ #
124
+ module ClassMethods
125
+ prepend Overrides::ClassMethods
126
+ end
116
127
  end
117
128
  end
@@ -3,5 +3,5 @@
3
3
  module SidekiqUniqueJobs
4
4
  #
5
5
  # @return [String] the current SidekiqUniqueJobs version
6
- VERSION = "7.1.21"
6
+ VERSION = "7.1.24"
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-unique-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.21
4
+ version: 7.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-25 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brpoplpush-redis_script