zhong 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/lib/zhong/scheduler.rb +5 -4
- data/lib/zhong/version.rb +1 -1
- data/zhong.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbe00de7a1e1f5b55ac8a34b0e1d0a13ac372217
|
4
|
+
data.tar.gz: d05ad774898928e6748e59c0d274485414c9f529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00ccb9f93043e62773fde4d74f1e9c045a1b18ee18ab7ce1a49137cb64b6b9d8ead36127ef4052d2c3fe5b538680d81000daef5ea44e3be2e8134f4fe5d39f59
|
7
|
+
data.tar.gz: 663b373808754bf6c22c78174aa853bbab0d198068bd6aa1b46f586d53ed00430efb437575d54403540c902e3c391d2f68015f8fc7f6e149a6cfa9cc1347a1af
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/zhong/scheduler.rb
CHANGED
@@ -6,7 +6,8 @@ module Zhong
|
|
6
6
|
timeout: 0.5,
|
7
7
|
grace: 15.minutes,
|
8
8
|
long_running_timeout: 5.minutes,
|
9
|
-
tz: nil
|
9
|
+
tz: nil,
|
10
|
+
heartbeat_key: "zhong:heartbeat",
|
10
11
|
}.freeze
|
11
12
|
|
12
13
|
def initialize(config = {})
|
@@ -143,11 +144,11 @@ module Zhong
|
|
143
144
|
end
|
144
145
|
|
145
146
|
def heartbeat(time)
|
146
|
-
@redis.
|
147
|
+
@redis.hset(config[:heartbeat_key], heartbeat_field, time.to_i)
|
147
148
|
end
|
148
149
|
|
149
|
-
def
|
150
|
-
@
|
150
|
+
def heartbeat_field
|
151
|
+
@heartbeat_field ||= "#{`hostname`.strip}##{Process.pid}"
|
151
152
|
end
|
152
153
|
|
153
154
|
def trap_signals
|
data/lib/zhong/version.rb
CHANGED
data/zhong.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zhong
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Elser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: suo
|
@@ -198,6 +198,20 @@ dependencies:
|
|
198
198
|
- - ">="
|
199
199
|
- !ruby/object:Gem::Version
|
200
200
|
version: '0'
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: pry
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - ">="
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: '0'
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: '0'
|
201
215
|
description: Reliable, distributed cron.
|
202
216
|
email:
|
203
217
|
- nick.elser@gmail.com
|