barbeque 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c235c801a5847d1f7ee491ead2247b9e3c08845a
4
- data.tar.gz: f2157e1f492cba1a78fc8e64d528abb850e144e7
3
+ metadata.gz: 0e1d8fb0c0f973f5c2787bfafd668f9b034e615f
4
+ data.tar.gz: 3d63e597722250a9cef9d183277b0bcb46a783d3
5
5
  SHA512:
6
- metadata.gz: '08626acefc490c6da1fe8abf979216974743335448aae55404551ae9d9cc43038729b928cef678b51f8f24f7703095b74071863d0f16fb1851432c96da0095e3'
7
- data.tar.gz: 299a6c177bf233a04d9bf9fbf6907014cf4663d7cb894459657592e0441030b6af760f90ec8ba89b0d3976cb800f8266d7198b23523723be32cedf29f379f54c
6
+ metadata.gz: 612bb73babd45a5d88e7b3e5ae2f644128577830beaa6ce15927ddb051e6967391535e73fe510e590fc07ebf6bf0c51fc0d2025b7951384fc467a5272dac1e57
7
+ data.tar.gz: df9967ad7ba78c739b4fbdebef2b75aa416d5d5d8a684f8be02903634f0f0fd37d1561a14ef7b54a2563b36ada1536f48baff7ce6ec4ab91cbc6d249db88bc63
@@ -14,9 +14,11 @@ module Barbeque
14
14
  end
15
15
 
16
16
  def run
17
- job_execution = Barbeque::JobExecution.find_or_initialize_by(message_id: @message.id)
18
- raise DuplicatedExecution if job_execution.persisted?
19
- job_execution.update!(job_definition: job_definition, job_queue_id: @job_queue.id)
17
+ begin
18
+ job_execution = Barbeque::JobExecution.create(message_id: @message.id, job_definition: job_definition, job_queue: @job_queue)
19
+ rescue ActiveRecord::RecordNotUnique => e
20
+ raise DuplicatedExecution.new(e.message)
21
+ end
20
22
 
21
23
  stdout, stderr, status = run_command
22
24
  job_execution.update!(status: status.success? ? :success : :failed, finished_at: Time.now)
@@ -16,8 +16,11 @@ module Barbeque
16
16
  end
17
17
 
18
18
  def run
19
- job_retry = Barbeque::JobRetry.find_or_initialize_by(message_id: @message.id)
20
- job_retry.update!(job_execution: job_execution)
19
+ begin
20
+ job_retry = Barbeque::JobRetry.create(message_id: @message.id, job_execution: job_execution)
21
+ rescue ActiveRecord::RecordNotUnique => e
22
+ raise DuplicatedExecution.new(e.message)
23
+ end
21
24
  job_execution.update!(status: 'retried')
22
25
 
23
26
  stdout, stderr, result = run_command
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
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: 0.2.2
4
+ version: 0.2.3
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-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adminlte2-rails
@@ -387,7 +387,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
387
387
  version: '0'
388
388
  requirements: []
389
389
  rubyforge_project:
390
- rubygems_version: 2.6.10
390
+ rubygems_version: 2.5.2
391
391
  signing_key:
392
392
  specification_version: 4
393
393
  summary: Job queue system to run job with Docker