serial_scheduler 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/serial_scheduler.rb +4 -4
- data/lib/serial_scheduler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3a506d86f511afd425f534d8c5751c3c4681325bafe00cb88e6fc9cef072ad6
|
4
|
+
data.tar.gz: c7bc9f006d4234ae1c2c138d8eba1836fb395dda9fe01a244e092ab8435b4266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd3b75323b5b0462bf4e7c96c0a33b9f1490c3247f4b2d77d89c0843ab407df91f0a29d75a008df646a6698c1059a6af098fb3ce616a2d30540dfa2de598a702
|
7
|
+
data.tar.gz: 30b5de606989d0f1700f84f55e03b3cb9c051cab56acbd398940dba3d92e926b9fdd82b5f7f05d8d8509734dd2020bfed3aff182240caa78e03031bcd2d02335
|
data/lib/serial_scheduler.rb
CHANGED
@@ -64,12 +64,12 @@ class SerialScheduler
|
|
64
64
|
now = Time.now.to_i
|
65
65
|
earliest = @producers.min_by(&:next)
|
66
66
|
wait = [earliest.next - now, 0].max # do not wait when overdue
|
67
|
+
target = Time.at(now + wait)
|
67
68
|
|
68
69
|
if wait > 0
|
69
|
-
@logger.info message: "Waiting to start job", job: earliest.name, in: wait, at:
|
70
|
-
|
71
|
-
break if @stopped
|
72
|
-
|
70
|
+
@logger.info message: "Waiting to start job", job: earliest.name, in: wait, at: target.to_s
|
71
|
+
loop do
|
72
|
+
break if @stopped || Time.now >= target # need to re-check or long waits will drift by .3%
|
73
73
|
sleep 1
|
74
74
|
end
|
75
75
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serial_scheduler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fugit
|