chained_job 0.8.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e9f9e1ba6cf71c7f15c911cadf78a528479803399a3cafb2c8c157dea1f58ee
4
- data.tar.gz: daef22987adf62315249d58f35432fcef78f9e14e57387f993676991e35ef711
3
+ metadata.gz: 5001820258c03c0def77d7795394d0247fb8178135374713781e6b14d582d599
4
+ data.tar.gz: 915a820681d77ed24ed57eb928b625435cf8a515a484152aac8e81d9fb39126d
5
5
  SHA512:
6
- metadata.gz: c3a315ffdfb640453c743e1feea71066d36f7c0251d72e549d9621116137f906b49cafc4eab9205e4fbd18a1d1537b56ac04717f02df1e6d8ded496882d6741d
7
- data.tar.gz: f006c04a8b0822eb035ca8cfca81a24694cc9c2581c25f4fba0de51e10a0d0d2d2b4f8cc786f7c77ba0114ee2cf3d862c422ca2ff88d56aaa024575465792496
6
+ metadata.gz: a1a991d28ef878a6f8bc0951dca256b8263ed4930f92938212d83d6819f00d4571f1f1396eeef491af4c51aab14341a58c0af69ce92d25b9cc15aed3c3b116dd
7
+ data.tar.gz: daa1495c6c891cc14f614e6a9e8471b06dcb7c7253349de54c3d4188293141e49f8ba0f21017ef36c956f08b280aad5a542e7cc2380365e7b5d40a6b3c7a207c
@@ -19,15 +19,15 @@ module ChainedJob
19
19
  # rubocop:disable Metrics/AbcSize
20
20
  def run
21
21
  loop do
22
- tag = ChainedJob.redis.spop(tag_list)
22
+ tag = ChainedJob.redis.call(:spop, tag_list)
23
23
 
24
24
  break unless tag
25
25
 
26
26
  redis_key = Helpers.redis_key(job_key, tag)
27
- size = ChainedJob.redis.llen(redis_key)
28
- (size / TRIM_STEP_SIZE).times { ChainedJob.redis.ltrim(redis_key, 0, -TRIM_STEP_SIZE) }
27
+ size = ChainedJob.redis.call(:llen, redis_key)
28
+ (size / TRIM_STEP_SIZE).times { ChainedJob.redis.call(:ltrim, redis_key, 0, -TRIM_STEP_SIZE) }
29
29
 
30
- ChainedJob.redis.del(redis_key)
30
+ ChainedJob.redis.call(:del, redis_key)
31
31
  end
32
32
  end
33
33
  # rubocop:enable Metrics/AbcSize
@@ -71,7 +71,7 @@ module ChainedJob
71
71
  def serialized_argument
72
72
  return @serialized_argument if defined?(@serialized_argument)
73
73
 
74
- @serialized_argument = ChainedJob.redis.lpop(redis_key)
74
+ @serialized_argument = ChainedJob.redis.call(:lpop, redis_key)
75
75
  end
76
76
 
77
77
  def redis_key
@@ -83,7 +83,7 @@ module ChainedJob
83
83
  end
84
84
 
85
85
  def push_job_arguments_back
86
- ChainedJob.redis.rpush(redis_key, Helpers.serialize([argument]))
86
+ ChainedJob.redis.call(:rpush, redis_key, Helpers.serialize([argument]))
87
87
  end
88
88
  end
89
89
  end
@@ -20,16 +20,16 @@ module ChainedJob
20
20
  set_tag_list
21
21
 
22
22
  array_of_job_arguments.each_slice(config.arguments_batch_size) do |sublist|
23
- ChainedJob.redis.rpush(redis_key, Helpers.serialize(sublist))
23
+ ChainedJob.redis.call(:rpush, redis_key, Helpers.serialize(sublist))
24
24
  end
25
25
 
26
- ChainedJob.redis.expire(redis_key, config.arguments_queue_expiration)
26
+ ChainedJob.redis.call(:expire, redis_key, config.arguments_queue_expiration)
27
27
  end
28
28
 
29
29
  private
30
30
 
31
31
  def set_tag_list
32
- ChainedJob.redis.sadd(tag_list, job_tag)
32
+ ChainedJob.redis.call(:sadd, tag_list, job_tag)
33
33
  end
34
34
 
35
35
  def tag_list
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ChainedJob
4
- VERSION = '0.8.1'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chained_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mantas Kūjalis
@@ -9,16 +9,16 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-06-10 00:00:00.000000000 Z
12
+ date: 2024-11-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: bundler
15
+ name: redis-client
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
- type: :development
21
+ type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
@@ -26,19 +26,19 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: minitest
29
+ name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '5.0'
34
+ version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '5.0'
41
+ version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rake
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.1.4
92
+ rubygems_version: 3.2.33
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Chained job helper