riverqueue 0.8.0 → 0.9.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +3 -3
  3. data/lib/insert_opts.rb +0 -6
  4. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46f45a18aa1b8884c93295ba1b023751c826d8feeac212949e18f388f3a6b6cc
4
- data.tar.gz: 679dde3151af410e5e8f8949d80750d68f247e300af1e6f93b43270d81dc5d40
3
+ metadata.gz: cd4c519a0fc96d577dfe456d77563c56facadb32c284d6a4f463f029ec219fb9
4
+ data.tar.gz: 15ef26e7d752054237e0a10a7a28238d17364ab7a8f1723cfc3c8ce02b2c2d57
5
5
  SHA512:
6
- metadata.gz: a7507d5e78f99ef0bb6cda3a91479da386bb5e66c18c40a26c98ed5aec42bb3b5425b3753e797759e4ca4117f9a01636d9784fd1b27d160af215e5e5216ac998
7
- data.tar.gz: a65b3a772b4d85b823256fe2bebb656a816cff1ba87777c77d9393670dbdfe3be383095bb49f3446d8110a143cb1ba68b9c7530d64da44a9e9093265be9aa8ba
6
+ metadata.gz: 1a1de7f781dc2b9fc2ae127567678de75d6a3fd032f065bfa023c5aec1266740765239cc801351b7a909b108a2a47263e46edc776a9c1ac4253cd3d01add34fd
7
+ data.tar.gz: 32f2b8be0923325db6dbfb5429827e258d5874a7be9407e7f79052d624a437b016cfbadc31130e3c373b11f5744d2b13e471da4d36d20f6d3c4d854691c8ba58
data/lib/client.rb CHANGED
@@ -210,7 +210,7 @@ module River
210
210
  if unique_opts.by_args
211
211
  parsed_args = JSON.parse(insert_params.encoded_args)
212
212
  filtered_args = if unique_opts.by_args.is_a?(Array)
213
- parsed_args.select { |k, _| unique_opts.by_args.include?(k) }
213
+ parsed_args.slice(*unique_opts.by_args)
214
214
  else
215
215
  parsed_args
216
216
  end
@@ -220,7 +220,7 @@ module River
220
220
  end
221
221
 
222
222
  if unique_opts.by_period
223
- lower_period_bound = truncate_time(@time_now_utc.call, unique_opts.by_period).utc
223
+ lower_period_bound = truncate_time(insert_params.scheduled_at || @time_now_utc.call, unique_opts.by_period).utc
224
224
 
225
225
  unique_key += "&period=#{lower_period_bound.strftime("%FT%TZ")}"
226
226
  end
@@ -249,7 +249,7 @@ module River
249
249
  [int].pack("Q").unpack1("q") #: Integer # rubocop:disable Layout/LeadingCommentSpace
250
250
  end
251
251
 
252
- TAG_RE = /\A[\w][\w\-]+[\w]\z/
252
+ TAG_RE = /\A\w[\w-]+\w\z/
253
253
  private_constant :TAG_RE
254
254
 
255
255
  private def validate_tags(tags)
data/lib/insert_opts.rb CHANGED
@@ -72,12 +72,6 @@ module River
72
72
  # given job kind, a single instance is allowed for each combination of args
73
73
  # and queues. If either args or queue is changed on a new job, it's allowed to
74
74
  # be inserted as a new job.
75
- #
76
- # Uniquenes is checked at insert time by taking a Postgres advisory lock,
77
- # doing a look up for an equivalent row, and inserting only if none was found.
78
- # There's no database-level mechanism that guarantees jobs stay unique, so if
79
- # an equivalent row is inserted out of band (or batch inserted, where a unique
80
- # check doesn't occur), it's conceivable that duplicates could coexist.
81
75
  class UniqueOpts
82
76
  # Indicates that uniqueness should be enforced for any specific instance of
83
77
  # encoded args for a job.
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riverqueue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Gentry
8
8
  - Brandur Leach
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-12-20 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: River is a fast job queue for Go. Use this gem in conjunction with gems
15
14
  riverqueue-activerecord or riverqueue-sequel to insert jobs in Ruby which will be
@@ -33,7 +32,6 @@ metadata:
33
32
  changelog_uri: https://github.com/riverqueue/riverqueue-ruby/blob/master/CHANGELOG.md
34
33
  rubygems_mfa_required: 'true'
35
34
  source_code_uri: https://github.com/riverqueue/riverqueue-ruby
36
- post_install_message:
37
35
  rdoc_options: []
38
36
  require_paths:
39
37
  - lib
@@ -48,8 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
48
46
  - !ruby/object:Gem::Version
49
47
  version: '0'
50
48
  requirements: []
51
- rubygems_version: 3.5.16
52
- signing_key:
49
+ rubygems_version: 3.6.7
53
50
  specification_version: 4
54
51
  summary: River is a fast job queue for Go.
55
52
  test_files: []