barbeque 1.4.0 → 1.4.1

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: f2e3f6682077d8c2aa1dc329ece9276955d0f4e8
4
- data.tar.gz: 5ce55e6f5c4b800749d13f203156ecbc76fc69e8
3
+ metadata.gz: 0cdb95733c48465dc1ded4986b0bbe415b84df84
4
+ data.tar.gz: ff6688e7c2b6afabd31a7df9a4d0fd9fe70fd573
5
5
  SHA512:
6
- metadata.gz: bf76c8ddc5d475c9361b1113b54cf02aa4220842e7577d00a37215a09493ad70473a43ce9aaf5d53db534958a47c6481f7e5e71001d70fd1d7181413c13f619b
7
- data.tar.gz: 2d83bb3f0a506d8294ff1b3f32d66210332ea9b7ee3a4c1322ef2a1702e9d86f716f41a3c22dd4db419b0549f0788ded1f1459273e1d0fe1859f2c1643087e84
6
+ metadata.gz: f7e3e84c1bc9a946d0906150c605835d3a9d42a2608a81859cb735275cd4a6b8586d233c05e3bef692b79589a97949c152fa6996ce5de0c545230b9f81bc8465
7
+ data.tar.gz: 4e36ad0423d6713a879b875e72e24a0b8f3a8bd6bcdc230cfdc42bd7758bd62f611d9c96846e3e4de501079bffbb241a8988e6cb94130b25bf6a3b19bb7e98f4
@@ -14,7 +14,6 @@ module Barbeque
14
14
 
15
15
  def run
16
16
  job_execution = create_job_execution
17
- @message_queue.delete_message(@message)
18
17
 
19
18
  begin
20
19
  Executor.create.start_execution(job_execution, job_envs)
@@ -49,6 +48,7 @@ module Barbeque
49
48
  Barbeque::JobExecution.transaction do
50
49
  Barbeque::JobExecution.create(message_id: @message.id, job_definition: job_definition, job_queue: @message_queue.job_queue).tap do |job_execution|
51
50
  Barbeque::ExecutionLog.save_message(job_execution, @message)
51
+ @message_queue.delete_message(@message)
52
52
  end
53
53
  end
54
54
  rescue ActiveRecord::RecordNotUnique => e
@@ -15,12 +15,7 @@ module Barbeque
15
15
  end
16
16
 
17
17
  def run
18
- begin
19
- job_retry = Barbeque::JobRetry.create(message_id: @message.id, job_execution: job_execution)
20
- rescue ActiveRecord::RecordNotUnique => e
21
- raise DuplicatedExecution.new(e.message)
22
- end
23
- @message_queue.delete_message(@message)
18
+ job_retry = create_job_retry
24
19
 
25
20
  begin
26
21
  Executor.create.start_retry(job_retry, job_envs)
@@ -52,6 +47,16 @@ module Barbeque
52
47
  'BARBEQUE_RETRY_COUNT' => job_execution.job_retries.count.to_s,
53
48
  }
54
49
  end
50
+
51
+ def create_job_retry
52
+ Barbeque::JobRetry.transaction do
53
+ Barbeque::JobRetry.create(message_id: @message.id, job_execution: job_execution).tap do
54
+ @message_queue.delete_message(@message)
55
+ end
56
+ end
57
+ rescue ActiveRecord::RecordNotUnique => e
58
+ raise DuplicatedExecution.new(e.message)
59
+ end
55
60
  end
56
61
  end
57
62
  end
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barbeque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-31 00:00:00.000000000 Z
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adminlte2-rails