elastic_whenever 0.4.0 → 0.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
- SHA1:
3
- metadata.gz: 221091fd69b334eb2e1a29e0d98f5bd8154d3a6c
4
- data.tar.gz: ed62915c7e06921b264dc21b9646a367cc747e13
2
+ SHA256:
3
+ metadata.gz: b3f6314849f075346152b2b861572f3d6cc9830044c7410a9dcbfdca08c13ecc
4
+ data.tar.gz: db5b26247b18515ba576853fbdb826872b0ba7b6a7df68e329ac2e0eb05ae76d
5
5
  SHA512:
6
- metadata.gz: 9173b91d178b252b455dd833e9d0bfdabf2dc730f593ac156c58ddc8bb55c268fcaf38614b7eda8402c8163b66a21a3caf15d114dd9b0b235b3c661853faae1d
7
- data.tar.gz: 3bbf59e2d2265073a59159f941555f5b6b8d27934eeb6363cc692eb52172ad4f7bff4d667ef64f852d7bee1f2d00a5291967d38f8d27d7a37ed7b9e5bbc4f87a
6
+ metadata.gz: a1cf65a4cfe1a0af4cde63bb839bb44aab6aa875121145662bb5284148bd7879ee7544af14c280a65fb865c7e604fa615e97f21cc3c695300895af94d53117dc
7
+ data.tar.gz: 8a06af3797352eb946e87b415c7eb40aed31a59bb6a3ff11b347f03a94fe88dab58305bc0fed2dbe9c01909aedfe1d9ce6f1a65065e8fcabfbf76b0e266dddc7
@@ -1,7 +1,9 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.5
5
- - 2.5.3
4
+ - 2.4.6
5
+ - 2.5.5
6
+ - 2.6.3
6
7
  before_install:
7
8
  - gem update --system
9
+ - gem install bundler
@@ -1,3 +1,13 @@
1
+ ## v0.4.1 (2019-07-23)
2
+
3
+ ### BugFixes
4
+
5
+ - Retry for concurrent modification ([#41](https://github.com/wata727/elastic_whenever/pull/41))
6
+
7
+ ### Chore
8
+
9
+ - CI against Ruby 2.6 ([#40](https://github.com/wata727/elastic_whenever/pull/40))
10
+
1
11
  ## v0.4.0 (2018-12-19)
2
12
 
3
13
  Elastic Whenever now supports Fargate launch type. Thanks @avinson.
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.15"
23
+ spec.add_development_dependency "bundler", "~> 2.0"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "rspec", "~> 3.0"
26
26
 
@@ -28,4 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency "aws-sdk-cloudwatchevents", "~> 1.5"
29
29
  spec.add_dependency "aws-sdk-iam", "~> 1.0"
30
30
  spec.add_dependency "chronic", "~> 0.10"
31
+ spec.add_dependency "retryable", "~> 3.0"
31
32
  end
@@ -5,6 +5,7 @@ require "aws-sdk-iam"
5
5
  require "chronic"
6
6
  require "singleton"
7
7
  require "json"
8
+ require "retryable"
8
9
 
9
10
  require "elastic_whenever/version"
10
11
  require "elastic_whenever/cli"
@@ -14,10 +14,14 @@ module ElasticWhenever
14
14
  Logger.instance.message("Run `elastic_whenever --help' for more options.")
15
15
  when Option::UPDATE_MODE
16
16
  option.validate!
17
- update_tasks(option, dry_run: false)
17
+ with_concurrent_modification_handling do
18
+ update_tasks(option, dry_run: false)
19
+ end
18
20
  Logger.instance.log("write", "scheduled tasks updated")
19
21
  when Option::CLEAR_MODE
20
- clear_tasks(option)
22
+ with_concurrent_modification_handling do
23
+ clear_tasks(option)
24
+ end
21
25
  Logger.instance.log("write", "shceduled tasks cleared")
22
26
  when Option::LIST_MODE
23
27
  list_tasks(option)
@@ -104,6 +108,19 @@ module ElasticWhenever
104
108
  puts
105
109
  end
106
110
  end
111
+
112
+ def with_concurrent_modification_handling
113
+ Retryable.retryable(
114
+ tries: 5,
115
+ on: Aws::CloudWatchEvents::Errors::ConcurrentModificationException,
116
+ sleep: lambda { |_n| rand(1..10) },
117
+ ) do |retries, exn|
118
+ if retries > 0
119
+ Logger.instance.warn("concurrent modification detected; Retrying...")
120
+ end
121
+ yield
122
+ end
123
+ end
107
124
  end
108
125
  end
109
126
  end
@@ -1,3 +1,3 @@
1
1
  module ElasticWhenever
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic_whenever
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuma Watanabe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-18 00:00:00.000000000 Z
11
+ date: 2019-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.10'
111
+ - !ruby/object:Gem::Dependency
112
+ name: retryable
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.0'
111
125
  description: Manage ECS Scheduled Tasks like Whenever
112
126
  email:
113
127
  - watassbass@gmail.com
@@ -158,8 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
172
  - !ruby/object:Gem::Version
159
173
  version: '0'
160
174
  requirements: []
161
- rubyforge_project:
162
- rubygems_version: 2.6.11
175
+ rubygems_version: 3.0.3
163
176
  signing_key:
164
177
  specification_version: 4
165
178
  summary: Manage ECS Scheduled Tasks like Whenever