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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6786d80a0d2da5fc3d4605ab95a511764b96e2e6
4
- data.tar.gz: 2c1f61feff58195e3e8521b7d965f0cb7ed0d616
3
+ metadata.gz: bbe00de7a1e1f5b55ac8a34b0e1d0a13ac372217
4
+ data.tar.gz: d05ad774898928e6748e59c0d274485414c9f529
5
5
  SHA512:
6
- metadata.gz: 3e9b281a5edbd9a6aa9c99ecff01b24f153c886ea2bf91d4659cf92ef858da518e5d96f18ce9b7e253372dc07e8749289fddff77104e72cd61df056fa72d9028
7
- data.tar.gz: e0c854e2d554048f88fa4368701c2d59e7e40dccb2d2165f43df3d9ffd679c382c485b1b2f566617a1de0dd17657aef9f2ed07d9f93bb394f6e3abcf9dbdcf85
6
+ metadata.gz: 00ccb9f93043e62773fde4d74f1e9c045a1b18ee18ab7ce1a49137cb64b6b9d8ead36127ef4052d2c3fe5b538680d81000daef5ea44e3be2e8134f4fe5d39f59
7
+ data.tar.gz: 663b373808754bf6c22c78174aa853bbab0d198068bd6aa1b46f586d53ed00430efb437575d54403540c902e3c391d2f68015f8fc7f6e149a6cfa9cc1347a1af
data/.gitignore CHANGED
@@ -17,3 +17,4 @@ zhong.rb
17
17
  test/tmp
18
18
  test/version_tmp
19
19
  tmp
20
+ *.swp
@@ -1,3 +1,7 @@
1
+ ## 0.1.9
2
+
3
+ - Much more performant heartbeat checks (thanks, @sherinkurian).
4
+
1
5
  ## 0.1.8
2
6
 
3
7
  - Make it very clear when callbacks cause skips of ticks or runs.
@@ -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.setex(heartbeat_key, @config[:grace].to_i, time.to_i)
147
+ @redis.hset(config[:heartbeat_key], heartbeat_field, time.to_i)
147
148
  end
148
149
 
149
- def heartbeat_key
150
- @heartbeat_key ||= "zhong:heartbeat:#{`hostname`.strip}##{Process.pid}"
150
+ def heartbeat_field
151
+ @heartbeat_field ||= "#{`hostname`.strip}##{Process.pid}"
151
152
  end
152
153
 
153
154
  def trap_signals
@@ -1,3 +1,3 @@
1
1
  module Zhong
2
- VERSION = "0.1.8".freeze
2
+ VERSION = "0.1.9".freeze
3
3
  end
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency "rack-test", "~> 0.6"
37
37
  spec.add_development_dependency "tilt"
38
38
  spec.add_development_dependency "erubis"
39
+ spec.add_development_dependency "pry"
39
40
  end
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.8
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-07 00:00:00.000000000 Z
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