sidekiq-batch 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56a9cb0fe2d48eba0959e20ad98e52e62e326bb71168f13f4c48e0ad33079447
4
- data.tar.gz: ae145f7d0381f9a83ec2f0ba93be5a290589b1cd77e7544fc20b4f15fc823d0e
3
+ metadata.gz: b70659750dde1e5afc337c6d8694055af5e103718a3719e3e12bffd66dbe191f
4
+ data.tar.gz: c47488bb9c1a9115e3bc9ee006190d3dd52534006b8bd74184810885e0dbbfcd
5
5
  SHA512:
6
- metadata.gz: 45aee8ac26397847e5738ebf21b34a7505cd367d64596b9e72ff1c51993c622e53850999cb9bcae4fa2152c7e0471c65d3c824af3af06cdefecee199b4f7c8a5
7
- data.tar.gz: 294c3bb0b9f908ee2aabf6dd62adcb296ff6409a148b3db77a456f50c728f369583bf15af4d2aa034947fb5175741985549c70d5328acb8ff471332689ad27c7
6
+ metadata.gz: afb196a979725830e0576d4d9f1756c7d3afba5298c46d22b575a9cfbab39fcefe19434f27fd80808d5082a92e127784eb543408e7848e50f5f78e962c5e66a6
7
+ data.tar.gz: 9cfd132e6beb024c493b6c8acbf7ea375604ed193575abc9ac64b6ee1c10e37992796f80f6441661d24efb9b55963b50e12959b56bb30bf6abb5de6226977125
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ open_collective: sidekiq-batch
@@ -0,0 +1,70 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL"
13
+
14
+ on:
15
+ push:
16
+ branches: [ master ]
17
+ pull_request:
18
+ # The branches below must be a subset of the branches above
19
+ branches: [ master ]
20
+ schedule:
21
+ - cron: '24 3 * * 2'
22
+
23
+ jobs:
24
+ analyze:
25
+ name: Analyze
26
+ runs-on: ubuntu-latest
27
+ permissions:
28
+ actions: read
29
+ contents: read
30
+ security-events: write
31
+
32
+ strategy:
33
+ fail-fast: false
34
+ matrix:
35
+ language: [ 'ruby' ]
36
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37
+ # Learn more about CodeQL language support at https://git.io/codeql-language-support
38
+
39
+ steps:
40
+ - name: Checkout repository
41
+ uses: actions/checkout@v3
42
+
43
+ # Initializes the CodeQL tools for scanning.
44
+ - name: Initialize CodeQL
45
+ uses: github/codeql-action/init@v2
46
+ with:
47
+ languages: ${{ matrix.language }}
48
+ # If you wish to specify custom queries, you can do so here or in a config file.
49
+ # By default, queries listed here will override any specified in a config file.
50
+ # Prefix the list here with "+" to use these queries and those in the config file.
51
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
52
+
53
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54
+ # If this step fails, then you should remove it and run the build manually (see below)
55
+ - name: Autobuild
56
+ uses: github/codeql-action/autobuild@v2
57
+
58
+ # ℹ️ Command-line programs to run using the OS shell.
59
+ # 📚 https://git.io/JvXDl
60
+
61
+ # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62
+ # and modify them (or add more) to build your code if your project
63
+ # uses a compiled language
64
+
65
+ #- run: |
66
+ # make bootstrap
67
+ # make release
68
+
69
+ - name: Perform CodeQL Analysis
70
+ uses: github/codeql-action/analyze@v2
@@ -40,10 +40,10 @@ module Sidekiq
40
40
 
41
41
  _, _, success, _, complete, pending, children, failure = Sidekiq.redis do |r|
42
42
  r.multi do |pipeline|
43
- pipeline.sadd("BID-#{parent_bid}-success", bid)
43
+ pipeline.sadd("BID-#{parent_bid}-success", [bid])
44
44
  pipeline.expire("BID-#{parent_bid}-success", Sidekiq::Batch::BID_EXPIRE_TTL)
45
45
  pipeline.scard("BID-#{parent_bid}-success")
46
- pipeline.sadd("BID-#{parent_bid}-complete", bid)
46
+ pipeline.sadd("BID-#{parent_bid}-complete", [bid])
47
47
  pipeline.scard("BID-#{parent_bid}-complete")
48
48
  pipeline.hincrby("BID-#{parent_bid}", "pending", 0)
49
49
  pipeline.hincrby("BID-#{parent_bid}", "children", 0)
@@ -81,7 +81,7 @@ module Sidekiq
81
81
  Sidekiq.logger.debug {"Finalize parent complete bid: #{parent_bid}"}
82
82
  _, complete, pending, children, failure = Sidekiq.redis do |r|
83
83
  r.multi do |pipeline|
84
- pipeline.sadd("BID-#{parent_bid}-complete", bid)
84
+ pipeline.sadd("BID-#{parent_bid}-complete", [bid])
85
85
  pipeline.scard("BID-#{parent_bid}-complete")
86
86
  pipeline.hincrby("BID-#{parent_bid}", "pending", 0)
87
87
  pipeline.hincrby("BID-#{parent_bid}", "children", 0)
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  class Batch
3
- VERSION = '0.1.8'.freeze
3
+ VERSION = '0.1.9'.freeze
4
4
  end
5
5
  end
data/lib/sidekiq/batch.rb CHANGED
@@ -43,10 +43,10 @@ module Sidekiq
43
43
  callback_key = "#{@bidkey}-callbacks-#{event}"
44
44
  Sidekiq.redis do |r|
45
45
  r.multi do |pipeline|
46
- pipeline.sadd(callback_key, JSON.unparse({
46
+ pipeline.sadd(callback_key, [JSON.unparse({
47
47
  callback: callback,
48
48
  opts: options
49
- }))
49
+ })])
50
50
  pipeline.expire(callback_key, BID_EXPIRE_TTL)
51
51
  end
52
52
  end
@@ -96,7 +96,7 @@ module Sidekiq
96
96
  pipeline.hincrby(@bidkey, "total", @ready_to_queue.size)
97
97
  pipeline.expire(@bidkey, BID_EXPIRE_TTL)
98
98
 
99
- pipeline.sadd(@bidkey + "-jids", @ready_to_queue)
99
+ pipeline.sadd(@bidkey + "-jids", [@ready_to_queue])
100
100
  pipeline.expire(@bidkey + "-jids", BID_EXPIRE_TTL)
101
101
  end
102
102
  end
@@ -149,7 +149,7 @@ module Sidekiq
149
149
  def process_failed_job(bid, jid)
150
150
  _, pending, failed, children, complete, parent_bid = Sidekiq.redis do |r|
151
151
  r.multi do |pipeline|
152
- pipeline.sadd("BID-#{bid}-failed", jid)
152
+ pipeline.sadd("BID-#{bid}-failed", [jid])
153
153
 
154
154
  pipeline.hincrby("BID-#{bid}", "pending", 0)
155
155
  pipeline.scard("BID-#{bid}-failed")
@@ -166,7 +166,7 @@ module Sidekiq
166
166
  Sidekiq.redis do |r|
167
167
  r.multi do |pipeline|
168
168
  pipeline.hincrby("BID-#{parent_bid}", "pending", 1)
169
- pipeline.sadd("BID-#{parent_bid}-failed", jid)
169
+ pipeline.sadd("BID-#{parent_bid}-failed", [jid])
170
170
  pipeline.expire("BID-#{parent_bid}-failed", BID_EXPIRE_TTL)
171
171
  end
172
172
  end
@@ -188,8 +188,8 @@ module Sidekiq
188
188
  pipeline.hget("BID-#{bid}", "total")
189
189
  pipeline.hget("BID-#{bid}", "parent_bid")
190
190
 
191
- pipeline.srem("BID-#{bid}-failed", jid)
192
- pipeline.srem("BID-#{bid}-jids", jid)
191
+ pipeline.srem("BID-#{bid}-failed", [jid])
192
+ pipeline.srem("BID-#{bid}-jids", [jid])
193
193
  pipeline.expire("BID-#{bid}", BID_EXPIRE_TTL)
194
194
  end
195
195
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Naglik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-24 00:00:00.000000000 Z
11
+ date: 2022-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq
@@ -87,8 +87,10 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".github/FUNDING.yml"
90
91
  - ".github/dependabot.yml"
91
92
  - ".github/workflows/ci.yml"
93
+ - ".github/workflows/codeql-analysis.yml"
92
94
  - ".github/workflows/stale.yml"
93
95
  - ".gitignore"
94
96
  - ".rspec"