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 +4 -4
- data/lib/chained_job/clean_up_queue.rb +4 -4
- data/lib/chained_job/process.rb +2 -2
- data/lib/chained_job/store_job_arguments.rb +3 -3
- data/lib/chained_job/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5001820258c03c0def77d7795394d0247fb8178135374713781e6b14d582d599
|
4
|
+
data.tar.gz: 915a820681d77ed24ed57eb928b625435cf8a515a484152aac8e81d9fb39126d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
28
|
-
(size / TRIM_STEP_SIZE).times { ChainedJob.redis.ltrim
|
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
|
30
|
+
ChainedJob.redis.call(:del, redis_key)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
# rubocop:enable Metrics/AbcSize
|
data/lib/chained_job/process.rb
CHANGED
@@ -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
|
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
|
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
|
23
|
+
ChainedJob.redis.call(:rpush, redis_key, Helpers.serialize(sublist))
|
24
24
|
end
|
25
25
|
|
26
|
-
ChainedJob.redis.expire
|
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
|
32
|
+
ChainedJob.redis.call(:sadd, tag_list, job_tag)
|
33
33
|
end
|
34
34
|
|
35
35
|
def tag_list
|
data/lib/chained_job/version.rb
CHANGED
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.
|
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:
|
12
|
+
date: 2024-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
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: :
|
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:
|
29
|
+
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - "
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '
|
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: '
|
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.
|
92
|
+
rubygems_version: 3.2.33
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
95
|
summary: Chained job helper
|