jobba 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +6 -0
- data/jobba.gemspec +1 -0
- data/lib/jobba/state.rb +1 -6
- data/lib/jobba/status.rb +9 -6
- data/lib/jobba/version.rb +1 -1
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 937d8738afd80bda5878ea1dad5d82310d5d4090c5de83788c0f427816328180
|
4
|
+
data.tar.gz: 1a23bbcc448af7634b683fe743fd8cc59a4b3cecd06575a7e076eb473caa5a0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3b9f488b84af546a31e5931abc4e67b9641324687c6c6272ce90cb0b3b2aaa3a2480ceb448aac485cda2e656d090d3a607b776891f65ba9f2c68fb87f3e196
|
7
|
+
data.tar.gz: 0cad4eb0d5c6016fba344849815ff0ec09236ce6cee8e8e52522db946442c4067553a867f301f1b6d92f2ca3fc575fb146cdf831e0b7d2f602062d3b69f0a72a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.3
|
data/.travis.yml
CHANGED
@@ -2,6 +2,10 @@ sudo: false
|
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
4
|
- 2.2.3
|
5
|
+
- 2.3.8
|
6
|
+
- 2.4.5
|
7
|
+
- 2.5.3
|
8
|
+
- 2.6.0
|
5
9
|
cache: bundler
|
6
10
|
bundler_args: --retry=6
|
7
11
|
script:
|
@@ -13,3 +17,5 @@ notifications:
|
|
13
17
|
env:
|
14
18
|
- USE_REAL_REDIS=false
|
15
19
|
- USE_REAL_REDIS=true
|
20
|
+
before_install:
|
21
|
+
- gem install bundler -v '< 2'
|
data/jobba.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_runtime_dependency "redis", "~> 3.2"
|
23
|
+
spec.add_runtime_dependency "oj", '~> 3.7.6'
|
23
24
|
spec.add_runtime_dependency "redis-namespace"
|
24
25
|
|
25
26
|
spec.add_development_dependency "bundler", "~> 1.10"
|
data/lib/jobba/state.rb
CHANGED
data/lib/jobba/status.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'json'
|
2
1
|
require 'ostruct'
|
2
|
+
require 'oj'
|
3
3
|
|
4
4
|
module Jobba
|
5
5
|
class Status
|
@@ -163,7 +163,11 @@ module Jobba
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def normalize_for_json(input)
|
166
|
-
|
166
|
+
Oj.load(convert_to_json(input))
|
167
|
+
end
|
168
|
+
|
169
|
+
def convert_to_json(value)
|
170
|
+
Oj.dump(value, mode: :custom, use_to_json: true)
|
167
171
|
end
|
168
172
|
|
169
173
|
def delete
|
@@ -219,7 +223,7 @@ module Jobba
|
|
219
223
|
def archive_attempt!
|
220
224
|
archived_job_key = job_key(attempt)
|
221
225
|
redis.rename(job_key, archived_job_key)
|
222
|
-
redis.hset(archived_job_key, :id, "#{id}:#{attempt}"
|
226
|
+
redis.hset(archived_job_key, :id, convert_to_json("#{id}:#{attempt}"))
|
223
227
|
delete_locally!
|
224
228
|
end
|
225
229
|
|
@@ -260,7 +264,7 @@ module Jobba
|
|
260
264
|
|
261
265
|
def load_from_json_encoded_attrs(attribute_name)
|
262
266
|
json = (@json_encoded_attrs || {})[attribute_name]
|
263
|
-
attribute = json.nil? ? nil :
|
267
|
+
attribute = json.nil? ? nil : Oj.load(json)
|
264
268
|
|
265
269
|
case attribute_name
|
266
270
|
when 'state'
|
@@ -298,8 +302,7 @@ module Jobba
|
|
298
302
|
key = kv_array[0]
|
299
303
|
value = kv_array[1]
|
300
304
|
value = Jobba::Utils.time_to_usec_int(value) if value.is_a?(::Time)
|
301
|
-
|
302
|
-
[key, value.to_json]
|
305
|
+
[key, convert_to_json(value)]
|
303
306
|
end
|
304
307
|
|
305
308
|
Jobba.redis.hmset(job_key, *redis_key_value_array)
|
data/lib/jobba/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: oj
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.7.6
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.7.6
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: redis-namespace
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
175
|
- !ruby/object:Gem::Version
|
162
176
|
version: '0'
|
163
177
|
requirements: []
|
164
|
-
|
165
|
-
rubygems_version: 2.4.5.1
|
178
|
+
rubygems_version: 3.0.2
|
166
179
|
signing_key:
|
167
180
|
specification_version: 4
|
168
181
|
summary: Redis-based background job status tracking.
|