barbeque 2.7.2 → 2.8.0

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
  SHA256:
3
- metadata.gz: 1105e3657e2e78f7555e3dc24ae47b6e36cb06a7c27b79fa7e4072b4966dd320
4
- data.tar.gz: 0f303b227dc439a7568ce0b6ab3950762502fde4f64b41b2da3355850fe6e9e8
3
+ metadata.gz: febc8fb62981217cb94e9614ebe9c303045555802bb010890ff796ae94024996
4
+ data.tar.gz: 10953be24a7344776dfee42281a7de2004b6abbfefb10b8b994f26fc4a6b8ec6
5
5
  SHA512:
6
- metadata.gz: 4c2c98729c4162d3e75e0b4e5dd3f8975b25a773bd2de8f759b84df4cebfc0b506005a59e9fea7687979648976ec3172e9b6cfaa9bfc2258816b526e55c9d5dd
7
- data.tar.gz: bea63fbf797baffac96a8bc70df54300a647ea0e795c99983c24263ccf551f3b169987567624e7975f422707ca13c08a6b32ec25742e4e12a36756243d199a1c
6
+ metadata.gz: 30d5b1f6ca098e0c932cf27266b30e2f24c50a08de8475c53fa8cc3d480b06e58ccb30a6aa26df7bc3e5672196f2f91f6f2ead8815ce27f1fca23402ea04d259
7
+ data.tar.gz: bdd41760b5cc5e1f04e24bd2ca3626d7b71839a381c308ccc3477579e35a12e175177e4772ab3f992187bb2e7ec73e270a4a09f1daeedf1c5080801b86c41857
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Barbeque [![Build Status](https://travis-ci.org/cookpad/barbeque.svg?branch=master)](https://travis-ci.org/cookpad/barbeque)
1
+ # Barbeque [![Build Status](https://github.com/cookpad/barbeque/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/cookpad/barbeque/actions/workflows/ci.yml)
2
2
 
3
3
  Job queue system to run job with Docker
4
4
 
@@ -98,6 +98,7 @@ class Barbeque::JobDefinitionsController < Barbeque::ApplicationController
98
98
  :app_id,
99
99
  :description,
100
100
  slack_notification_attributes: slack_notification_params,
101
+ retry_config_attributes: retry_config_params,
101
102
  )
102
103
  end
103
104
  end
@@ -100,12 +100,12 @@
100
100
  Retry
101
101
  .row
102
102
  .col-xs-4
103
- = link_to url_for(request.query_parameters.merge(page: @job_executions.prev_page)),
103
+ = link_to path_to_prev_page(@job_executions),
104
104
  class: "btn btn-default btn-sm btn-block #{'disabled' unless @job_executions.prev_page}" do
105
105
  %i.fa.fa-angle-left
106
106
  New
107
107
  .col-xs-4.col-xs-offset-4
108
- = link_to url_for(request.query_parameters.merge(page: @job_executions.next_page)),
108
+ = link_to path_to_next_page(@job_executions),
109
109
  class: "btn btn-default btn-sm btn-block #{'disabled' unless @job_executions.next_page}" do
110
110
  Old
111
111
  %i.fa.fa-angle-right
@@ -5,6 +5,7 @@ module Barbeque
5
5
  attr_reader :id # [String] Barbeque::JobExecution is associated via `message_id`
6
6
  attr_reader :receipt_handle # [String] Used to ack a message
7
7
  attr_reader :type # [String] "JobExecution", "JobRetry", etc
8
+ attr_reader :sent_timestamp # [String] The time the message was sent to the queue (epoch time in milliseconds)
8
9
 
9
10
  # @param [Aws::SQS::Types::Message] raw_message
10
11
  # @param message_body [Hash] parse result of `raw_message.body`
@@ -12,6 +13,7 @@ module Barbeque
12
13
  assign_body(message_body)
13
14
  @id = raw_message.message_id
14
15
  @receipt_handle = raw_message.receipt_handle
16
+ @sent_timestamp = raw_message.attributes['SentTimestamp']
15
17
  end
16
18
 
17
19
  # To distinguish with `Barbeque::Message::InvalidMessage`
@@ -34,6 +34,7 @@ module Barbeque
34
34
  'BARBEQUE_MESSAGE_ID' => @message.id,
35
35
  'BARBEQUE_QUEUE_NAME' => @message_queue.job_queue.name,
36
36
  'BARBEQUE_RETRY_COUNT' => '0',
37
+ 'BARBEQUE_SENT_TIMESTAMP' => @message.sent_timestamp,
37
38
  }
38
39
  end
39
40
 
@@ -52,6 +53,9 @@ module Barbeque
52
53
  end
53
54
  end
54
55
  rescue ActiveRecord::RecordNotUnique => e
56
+ # There's a case where Barbeque receives message which was already received or deleted.
57
+ # https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html
58
+ @message_queue.delete_message(@message)
55
59
  raise DuplicatedExecution.new(e.message)
56
60
  end
57
61
  end
@@ -45,6 +45,7 @@ module Barbeque
45
45
  'BARBEQUE_MESSAGE_ID' => @message.retry_message_id,
46
46
  'BARBEQUE_QUEUE_NAME' => @message_queue.job_queue.name,
47
47
  'BARBEQUE_RETRY_COUNT' => job_execution.job_retries.count.to_s,
48
+ 'BARBEQUE_SENT_TIMESTAMP' => @message.sent_timestamp,
48
49
  }
49
50
  end
50
51
 
@@ -48,6 +48,7 @@ module Barbeque
48
48
  queue_url: @job_queue.queue_url,
49
49
  wait_time_seconds: Barbeque.config.sqs_receive_message_wait_time,
50
50
  max_number_of_messages: 1,
51
+ attribute_names: ['SentTimestamp'],
51
52
  )
52
53
  if result.messages[0]
53
54
  Barbeque::Message.parse(result.messages[0])
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '2.7.2'
2
+ VERSION = '2.8.0'
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: 2.7.2
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-05 00:00:00.000000000 Z
11
+ date: 2021-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adminlte2-rails
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 1.2.1
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 1.2.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rails
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -461,7 +461,7 @@ homepage: https://github.com/cookpad/barbeque
461
461
  licenses:
462
462
  - MIT
463
463
  metadata: {}
464
- post_install_message:
464
+ post_install_message:
465
465
  rdoc_options: []
466
466
  require_paths:
467
467
  - lib
@@ -476,8 +476,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
476
476
  - !ruby/object:Gem::Version
477
477
  version: '0'
478
478
  requirements: []
479
- rubygems_version: 3.0.3
480
- signing_key:
479
+ rubygems_version: 3.1.6
480
+ signing_key:
481
481
  specification_version: 4
482
482
  summary: Job queue system to run job with Docker
483
483
  test_files: []