sidekiq-unique-jobs 7.1.7 → 7.1.8

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: caf49af950fdcdac84c9c4d4567cfb8697aa93c21640b7e32368e42e20808708
4
- data.tar.gz: aec81add0a9d86582d03c104600e0aee90429cd437928761f91d7350a415dc6b
3
+ metadata.gz: f0525a9235a69f86ef177c23a54afea5977a4a99fe4c09867d88c88d29eeb280
4
+ data.tar.gz: f105453b5082cb2a37ff2484e8c92213ec578a488b5f97f894b7f06e901aca23
5
5
  SHA512:
6
- metadata.gz: 6f1a2c59d5facc875f25f1436fb04ef2ef36023212476b2ce036694094df8c00e11cdf16f936c67ba649ef2705e6d915bce6f93ac13c3ae50c4bdbba3f83f9f7
7
- data.tar.gz: 0110e9e2ea06c40c39f083315254510de87d3c411d494047f0af9bc97586403edf88cf09d553a98046d750546dd283acc247a3627ecf623a67516004d6493eea
6
+ metadata.gz: 24eeed23d326f74ebf0c06d34913c8429d1ce7848bdb384606176bf8362ae74f8e1a3dbd0cffad10fbdac1344fe7a1170804e332f5974713c890f6fb330fae91
7
+ data.tar.gz: 61ce06ebeb3b49f25dbb3ffb12cfe90f164e9c668756e47b81d527181f66e27a07dc836f5230bb1949ca94429c59bdfe2fa7bc13c3dbac3a53ebe1feb2257080
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [v7.0.13](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.13) (2021-09-27)
4
+
5
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.7...v7.0.13)
6
+
7
+ ## [v7.1.7](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.7) (2021-09-27)
8
+
9
+ [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.6...v7.1.7)
10
+
11
+ **Implemented enhancements:**
12
+
13
+ - Styles [\#642](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/642) ([mhenrixon](https://github.com/mhenrixon))
14
+
15
+ **Fixed bugs:**
16
+
17
+ - OnConflict::Replace: yield when lock was achieved [\#640](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/640) ([mhenrixon](https://github.com/mhenrixon))
18
+
3
19
  ## [v7.1.6](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.1.6) (2021-09-21)
4
20
 
5
21
  [Full Changelog](https://github.com/mhenrixon/sidekiq-unique-jobs/compare/v7.1.5...v7.1.6)
@@ -125,7 +141,6 @@
125
141
 
126
142
  **Fixed bugs:**
127
143
 
128
- - lock\_info set to true but no lock info showing up in web ui [\#589](https://github.com/mhenrixon/sidekiq-unique-jobs/issues/589)
129
144
  - Fix recording lock\_info [\#599](https://github.com/mhenrixon/sidekiq-unique-jobs/pull/599) ([mhenrixon](https://github.com/mhenrixon))
130
145
 
131
146
  ## [v7.0.8](https://github.com/mhenrixon/sidekiq-unique-jobs/tree/v7.0.8) (2021-04-14)
@@ -31,7 +31,8 @@ module SidekiqUniqueJobs
31
31
  #
32
32
  # @param [String] pattern a key pattern to match with
33
33
  # @param [Integer] count the maximum number
34
- # @return [Array<String>] with unique digests
34
+ # @return [Hash<String,Float>] Hash mapping of digest matching the given pattern and score
35
+
35
36
  def delete_by_pattern(pattern, count: DEFAULT_COUNT)
36
37
  result, elapsed = timed do
37
38
  digests = entries(pattern: pattern, count: count).keys
@@ -80,11 +81,7 @@ module SidekiqUniqueJobs
80
81
  options[:match] = pattern
81
82
  options[:count] = count
82
83
 
83
- result = redis { |conn| conn.zscan_each(key, **options).to_a }
84
-
85
- result.each_with_object({}) do |entry, hash|
86
- hash[entry[0]] = entry[1]
87
- end
84
+ redis { |conn| conn.zscan_each(key, **options).to_a }.to_h
88
85
  end
89
86
 
90
87
  #
@@ -76,6 +76,9 @@ if pttl and pttl > 0 then
76
76
 
77
77
  log_debug("PEXPIRE", locked, pttl)
78
78
  redis.call("PEXPIRE", locked, pttl)
79
+
80
+ log_debug("PEXPIRE", info, pttl)
81
+ redis.call("PEXPIRE", info, pttl)
79
82
  end
80
83
 
81
84
  log_debug("PEXPIRE", queued, 1000)
@@ -84,9 +87,6 @@ redis.call("PEXPIRE", queued, 1000)
84
87
  log_debug("PEXPIRE", primed, 1000)
85
88
  redis.call("PEXPIRE", primed, 1000)
86
89
 
87
- log_debug("PEXPIRE", info, 1000)
88
- redis.call("PEXPIRE", info, 1000)
89
-
90
90
  log("Locked")
91
91
  log_debug("END lock digest:", digest, "job_id:", job_id)
92
92
  return job_id
@@ -76,6 +76,7 @@ local del_cmd = "DEL"
76
76
  if tonumber(redis_version["major"]) >= 4 then del_cmd = "UNLINK"; end
77
77
 
78
78
  if lock_type ~= "until_expired" then
79
+
79
80
  log_debug(del_cmd, digest, info)
80
81
  redis.call(del_cmd, digest, info)
81
82
 
@@ -83,6 +84,13 @@ if lock_type ~= "until_expired" then
83
84
  redis.call("HDEL", locked, job_id)
84
85
  end
85
86
 
87
+ local locked_count = redis.call("HLEN", locked)
88
+
89
+ if tonumber(locked_count) < 1 then
90
+ log_debug(del_cmd, locked)
91
+ redis.call(del_cmd, locked)
92
+ end
93
+
86
94
  log_debug("LPUSH", queued, "1")
87
95
  redis.call("LPUSH", queued, "1")
88
96
 
@@ -3,5 +3,5 @@
3
3
  module SidekiqUniqueJobs
4
4
  #
5
5
  # @return [String] the current SidekiqUniqueJobs version
6
- VERSION = "7.1.7"
6
+ VERSION = "7.1.8"
7
7
  end
@@ -16,7 +16,7 @@ COMMIT_CHANGELOG_CMD = "git commit -a -m 'Update changelog'"
16
16
 
17
17
  desc "Generate a Changelog"
18
18
  task :changelog do
19
- sh("git checkout master")
19
+ sh("git checkout main")
20
20
  sh(*CHANGELOG_CMD.push(ENV["CHANGELOG_GITHUB_TOKEN"]))
21
21
  sh(ADD_CHANGELOG_CMD)
22
22
  sh(COMMIT_CHANGELOG_CMD)
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.7
4
+ version: 7.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2021-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: brpoplpush-redis_script
@@ -223,7 +223,7 @@ metadata:
223
223
  post_install_message: |
224
224
  IMPORTANT!
225
225
 
226
- Automatic configuration of the sidekiq middelware is no longer done.
226
+ Automatic configuration of the sidekiq middleware is no longer done.
227
227
  Please see: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/README.md#add-the-middleware
228
228
 
229
229
  This version deprecated the following sidekiq_options