dynarex_cron 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/dynarex_cron.rb +24 -19
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdc7ce3471d1815443b06f59c463e6fd4044e627
|
4
|
+
data.tar.gz: fd9f687da9c0b2386ed8d1dd3f7be591af338d13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e131466356dca6d8bd81058d17ea6079dec47279bbf339dea293ce8d45a73e1f79a53d32e93899439c08d36e684c34a93ddbc87a33e5d24200768e7ab4473c74
|
7
|
+
data.tar.gz: 1ae2fe7add97b0033e9dfd156d2f0c2fa7ca33facac60dff39f693fe153c46b7da031029c5422a05e8b6957c7c3c93c6077c2651f4a6d8abbdfa7af936993919
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/dynarex_cron.rb
CHANGED
@@ -28,7 +28,7 @@ class DynarexCron
|
|
28
28
|
|
29
29
|
if @dxfile then
|
30
30
|
|
31
|
-
dynarex = load_doc dxfile
|
31
|
+
dynarex,_ = load_doc dxfile
|
32
32
|
load_entries(dynarex)
|
33
33
|
end
|
34
34
|
|
@@ -58,10 +58,13 @@ class DynarexCron
|
|
58
58
|
# What happens if the @dxfile is a URL and the web server is
|
59
59
|
# temporarily unavailable? i.e. 503 Service Temporarily Unavailable
|
60
60
|
begin
|
61
|
-
|
62
|
-
|
61
|
+
|
62
|
+
dx, buffer = load_doc(@dxfile)
|
63
|
+
load_entries dx if @buffer != buffer
|
64
|
+
@buffer = buffer
|
65
|
+
|
63
66
|
rescue
|
64
|
-
|
67
|
+
@log.debug 'DynarexCron/start: warning: ' + ($!).inspect
|
65
68
|
end
|
66
69
|
|
67
70
|
end
|
@@ -84,20 +87,24 @@ class DynarexCron
|
|
84
87
|
if dynarex_file.is_a?(Dynarex) then
|
85
88
|
dynarex_file
|
86
89
|
else
|
87
|
-
|
88
|
-
|
90
|
+
|
91
|
+
buffer, _ = RXFHelper.read(dynarex_file)
|
92
|
+
dx = buffer =~ /<?dynarex/ ? Dynarex.new.import(buffer) : \
|
93
|
+
Dynarex.new(buffer)
|
94
|
+
|
95
|
+
[dx, buffer]
|
89
96
|
end
|
90
97
|
|
91
98
|
end
|
92
99
|
|
93
|
-
def load_entries(
|
100
|
+
def load_entries(dx)
|
94
101
|
|
95
|
-
if
|
96
|
-
@sps_address, @sps_port =
|
102
|
+
if dx.summary[:sps_address] then
|
103
|
+
@sps_address, @sps_port = dx.summary[:sps_address]\
|
97
104
|
.split(':',2) << '59000'
|
98
105
|
end
|
99
106
|
|
100
|
-
@cron_entries =
|
107
|
+
@cron_entries = dx.to_h
|
101
108
|
@cron_entries.each do |h|
|
102
109
|
h[:cron] = ChronicCron.new(h[:expression], Time.now + @time_offset)
|
103
110
|
end
|
@@ -109,8 +116,12 @@ class DynarexCron
|
|
109
116
|
cron_entries.each do |h|
|
110
117
|
|
111
118
|
datetime = (Time.now + @time_offset).strftime(DF)
|
112
|
-
|
113
|
-
|
119
|
+
|
120
|
+
if @log then
|
121
|
+
@log.info 'DynarexCron/iterate: datetime: ' + datetime
|
122
|
+
@log.info 'DynarexCron/iterate: cron.to_time: ' \
|
123
|
+
+ h[:cron].to_time.strftime(DF)
|
124
|
+
end
|
114
125
|
|
115
126
|
if h[:cron].to_time.strftime(DF) == datetime then
|
116
127
|
|
@@ -141,10 +152,4 @@ class DynarexCron
|
|
141
152
|
end
|
142
153
|
end
|
143
154
|
|
144
|
-
|
145
|
-
|
146
|
-
load_entries Dynarex.new(buffer)
|
147
|
-
@buffer = buffer
|
148
|
-
end
|
149
|
-
|
150
|
-
end
|
155
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynarex_cron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
tsPyW5OuDQXshrgmPt97DD8Btg4Tg5CGwnm0aeVYC/E4PnCMrtQNyPaRwBfvGrF0
|
32
32
|
vXqXm6nxDCrL/w==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-12-
|
34
|
+
date: 2017-12-11 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: chronic_cron
|
metadata.gz.sig
CHANGED
Binary file
|