crono_trigger 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crono_trigger/execution_tracker.rb +2 -0
- data/lib/crono_trigger/schedulable.rb +13 -10
- data/lib/crono_trigger/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: ecbd02943a3f5c0feb5dcf4334620908db415b0b6686a085e5f93d0d80bc0cf8
|
4
|
+
data.tar.gz: 6b57f0fee70f788bd50a193776c279104599c41289c5397942940a4a4d4817d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ab99ff92c4f71a8dc5a38a57016da53605e9a3cba0441fbebe62a30788352ac591af92975929a84d730007f958c241ab2de52f057ddcfa0fa6e34f713bad596
|
7
|
+
data.tar.gz: 80cbcd2b1bf047608d82f61adfaa3fdfd3a1da5189e4ab346edc8855f5d7884a0bb3337d426536b57c796fffd412682f0c6e255da9fe00e37e022753ad9bb98b
|
@@ -21,6 +21,7 @@ module CronoTrigger
|
|
21
21
|
end
|
22
22
|
|
23
23
|
class AbortExecution < StandardError; end
|
24
|
+
class RetryExecution < StandardError; end
|
24
25
|
|
25
26
|
extend ActiveSupport::Concern
|
26
27
|
include ActiveSupport::Callbacks
|
@@ -113,21 +114,21 @@ module CronoTrigger
|
|
113
114
|
def do_execute
|
114
115
|
execution_tracker = ExecutionTracker.new(self)
|
115
116
|
run_callbacks :execute do
|
116
|
-
|
117
|
-
catch(:
|
118
|
-
catch(:
|
119
|
-
catch(:
|
120
|
-
|
117
|
+
execution_tracker.track do
|
118
|
+
catch(:ok_without_reset) do
|
119
|
+
catch(:ok) do
|
120
|
+
catch(:retry) do
|
121
|
+
catch(:abort) do
|
121
122
|
execute
|
123
|
+
throw :ok
|
122
124
|
end
|
123
|
-
|
125
|
+
raise AbortExecution
|
124
126
|
end
|
125
|
-
|
127
|
+
retry!
|
128
|
+
raise RetryExecution
|
126
129
|
end
|
127
|
-
|
128
|
-
return
|
130
|
+
reset!
|
129
131
|
end
|
130
|
-
reset!
|
131
132
|
end
|
132
133
|
end
|
133
134
|
rescue AbortExecution => ex
|
@@ -135,6 +136,8 @@ module CronoTrigger
|
|
135
136
|
reset!(false)
|
136
137
|
|
137
138
|
raise
|
139
|
+
rescue RetryExecution => ex
|
140
|
+
save_last_error_info(ex)
|
138
141
|
rescue Exception => ex
|
139
142
|
save_last_error_info(ex)
|
140
143
|
retry_or_reset!(ex)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crono_trigger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chrono
|