lowkiq 1.0.3 → 1.0.4

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: f492057b98cba44b9c22db8f0344823a267f19646defbe6c31269b1fc525e416
4
- data.tar.gz: 31450dc9d3a9b6dac7e16cbd14bc84db0c947276b3499047969ca75f2939b5b2
3
+ metadata.gz: c2b13ccb79c80bb58f09ba2ebe9fa23b7bfcee3e449c7982c51f2a4ad4290308
4
+ data.tar.gz: '02322860fde3de91215a635867a8bf4400147ad824bfeb67d5cc06c8208be3d7'
5
5
  SHA512:
6
- metadata.gz: f02ada15af2434cbb991331a2b2b415f1f632e568b2cc1867431c4f9e515901a3a5498e054ba7a72b1fe0b576f4148922a2d7b1717bc45142ebeab14172bedd3
7
- data.tar.gz: af480933334f8f36693f7695425d57a24154bd62d097a14ad12ae8bce0ca1a17169a5e85c25bb1229619d4bc48bb7d298257c20845ea0f4b8bcd77e5b36a3b0b
6
+ metadata.gz: 559466b6e35738653122d52524ae47d5b36edb7823a0e3a1ba815df50c4f0bd60cb4513b8576a667c088455fd13e0ac323dc46657f9aab4400598bef45998423
7
+ data.tar.gz: e2ebad80e86410a1ff13a417ec3d5489c17a9d8b4b189abfc5a4a98e7d924530c25c5c1f37b59bf26e5dec881f7fa231a7f1acf5fcb5f460ac7a9191468e2e3b
@@ -38,16 +38,13 @@ module Lowkiq
38
38
  def pop(shard, limit:)
39
39
  @pool.with do |redis|
40
40
  data = nil
41
- tx = redis.watch @keys.ids_scored_by_perform_in_zset(shard) do
42
- ids = redis.zrangebyscore @keys.ids_scored_by_perform_in_zset(shard),
43
- 0, @timestamp.call,
44
- limit: [0, limit]
45
-
46
- if ids.empty?
47
- redis.unwatch
48
- return []
49
- end
41
+ ids = redis.zrangebyscore @keys.ids_scored_by_perform_in_zset(shard),
42
+ 0, @timestamp.call,
43
+ limit: [0, limit]
44
+ return [] if ids.empty?
50
45
 
46
+ payloads_keys = ids.map { |id| @keys.payloads_zset id }
47
+ tx = redis.watch *payloads_keys do
51
48
  data = @fetch.fetch(redis, :pipelined, ids)
52
49
 
53
50
  redis.multi do
@@ -1,3 +1,3 @@
1
1
  module Lowkiq
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lowkiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Kuzmin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-06 00:00:00.000000000 Z
11
+ date: 2020-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis