allora 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/allora/backend/redis.rb +5 -1
- data/lib/allora/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/lib/allora/backend/redis.rb
CHANGED
@@ -33,6 +33,7 @@ module Allora
|
|
33
33
|
class Backend::Redis < Backend
|
34
34
|
attr_reader :redis
|
35
35
|
attr_reader :prefix
|
36
|
+
attr_reader :ttl
|
36
37
|
|
37
38
|
# Initialize the Redis backed with the given options.
|
38
39
|
#
|
@@ -41,13 +42,15 @@ module Allora
|
|
41
42
|
# host: the hostname of a Redis server
|
42
43
|
# port: the port number of a Redis server
|
43
44
|
# prefix: a namespace prefix to use
|
44
|
-
# reset: delete existing job timing
|
45
|
+
# reset: delete existing job timing entries in Redis
|
46
|
+
# ttl: ttl for job timing entries in Redis
|
45
47
|
#
|
46
48
|
# @param [Hash] opts
|
47
49
|
# options for the Redis backend
|
48
50
|
def initialize(opts = {})
|
49
51
|
@redis = create_redis(opts)
|
50
52
|
@prefix = opts.fetch(:prefix, "allora")
|
53
|
+
@ttl = Integer opts.fetch(:ttl, 0)
|
51
54
|
|
52
55
|
reset! if opts.fetch(:reset, true)
|
53
56
|
end
|
@@ -89,6 +92,7 @@ module Allora
|
|
89
92
|
if run_at <= time
|
90
93
|
redis.multi do
|
91
94
|
redis.set(job_info_key(name), time_to_int(job.next_at(time)))
|
95
|
+
redis.expire(job_info_key(name), ttl) if ttl > 0
|
92
96
|
end
|
93
97
|
else
|
94
98
|
redis.unwatch && false
|
data/lib/allora/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-07-
|
12
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|