crono_trigger 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7a1befee8d18a2c52458baa240cc2b12a8d9fea015a53647c0f098cae21d062d
4
- data.tar.gz: c6fad9a37fdf912c88712c93b64ace75386b9c2f37cdc9bcf609de711a7b8939
3
+ metadata.gz: ecbd02943a3f5c0feb5dcf4334620908db415b0b6686a085e5f93d0d80bc0cf8
4
+ data.tar.gz: 6b57f0fee70f788bd50a193776c279104599c41289c5397942940a4a4d4817d0
5
5
  SHA512:
6
- metadata.gz: 7d383986c2c68d31dbe6fa681599816e564c07dfa3bba92c4edf9cb8b581b934293636446d97a85c2fec87f64af9cd2c81b7ec6edcfc89fe9c905dac6ce1eaf3
7
- data.tar.gz: 4940e47e60802b4cf2caab3eee22069ba61e1f81b0178b1f696c485c330b5b5340d9d058764f70e40a608839cb2d35354ea877e3bbe32c9377d61fbbaa71233c
6
+ metadata.gz: 6ab99ff92c4f71a8dc5a38a57016da53605e9a3cba0441fbebe62a30788352ac591af92975929a84d730007f958c241ab2de52f057ddcfa0fa6e34f713bad596
7
+ data.tar.gz: 80cbcd2b1bf047608d82f61adfaa3fdfd3a1da5189e4ab346edc8855f5d7884a0bb3337d426536b57c796fffd412682f0c6e255da9fe00e37e022753ad9bb98b
@@ -8,7 +8,9 @@ module CronoTrigger
8
8
  if @schedulable.track_execution
9
9
  begin
10
10
  execution = @schedulable.crono_trigger_executions.create_with_timestamp!
11
+ p "fuuuuuuu"
11
12
  pr.call
13
+ p "hogehoge"
12
14
  execution.complete!
13
15
  rescue => e
14
16
  execution.error!(e)
@@ -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
- catch(:ok_without_reset) do
117
- catch(:ok) do
118
- catch(:retry) do
119
- catch(:abort) do
120
- execution_tracker.track do
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
- throw :ok
125
+ raise AbortExecution
124
126
  end
125
- raise AbortExecution
127
+ retry!
128
+ raise RetryExecution
126
129
  end
127
- retry!
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)
@@ -1,3 +1,3 @@
1
1
  module CronoTrigger
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
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.0
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-25 00:00:00.000000000 Z
11
+ date: 2019-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chrono