ecs-easy-cluster 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: a16a8b4f530e203e99ec31aa3c2b4f55e18cc42b
4
- data.tar.gz: 6cc1b2c1c06e6a39912206544ca2dc95eb40e0ba
3
+ metadata.gz: 79863dc07a8eab32cf0fceccdf7551ce5e2dccd2
4
+ data.tar.gz: 466d0dd80e222094cc0041f414e81bb113fb50c3
5
5
  SHA512:
6
- metadata.gz: cb4d9383c09a413fa137e32a878dbff86a6352a3243da85d0d5bbeb24033633aaeb0478c38f507d728ee1f2a85baa307192d72d239263e9f7b70dff300fda378
7
- data.tar.gz: a2c89af6d47072ef66aa8d9742a7bf9727d45cb5187bfa63a104572015ab1839c4280f4044121eb8b3d52726f0b60d8df8678e966bd68f7f16df07dbd9c65d89
6
+ metadata.gz: b63e90c6af6f3dff5b65f622f6e7f3af1c922292c1dc8a18aa9e57810a4a413707f0e564dea18bd101b7e6238f99b5e78b5fb6ea799db24b0fd3d03023fcacf9
7
+ data.tar.gz: 42c45c024ccc3feb0b64893159d2ced1e005b11ee44aca55fccad644b3a4d446f1a1fbf561dcbda60f8a637562928f4a12d30b5975b2197d94a5c52178f49b6e
@@ -32,7 +32,7 @@ module Ecs::Easy::Cluster
32
32
  end
33
33
  end
34
34
 
35
- retry_count = 3
35
+ retry_count = 0
36
36
  begin
37
37
  wait_until_ready
38
38
  res = run_task!( task_definition, overrides )
@@ -45,22 +45,23 @@ module Ecs::Easy::Cluster
45
45
  when "RESOURCE:MEMORY"
46
46
  puts "No enough memory on current container instances to execute this task. Add another container instance automatically."
47
47
 
48
- if num_instances >= max_instances
49
- puts "Couldn\'t scale more instances because it reaches maximum instances. You should upgrade the maximum number of instance to execute multiple tasks at the same time."
50
- end
51
48
  unless acceptable_task?( task_definition )
52
49
  raise "Couldn\'t accept this task because of the lack of memory. You should upgrade ec2 instance type."
53
50
  end
54
51
 
55
- scale!
52
+ if num_instances >= max_instances
53
+ puts "Couldn\'t scale more instances because it reaches maximum instances. You should upgrade the maximum number of instance to execute multiple tasks at the same time."
54
+ else
55
+ scale!
56
+ end
56
57
  else
57
58
  raise "Unknown reason: #{e.failures}"
58
59
  end
59
60
 
60
61
  puts "Failed to run the task. Try again."
61
62
  sleep 10
62
- retry_count -= 1
63
- retry if retry_count > 0
63
+ retry_count += 1
64
+ retry if retry_count <= 3
64
65
  rescue => e
65
66
  raise "Unknown reason: #{e}"
66
67
  end
@@ -1,7 +1,7 @@
1
1
  module Ecs
2
2
  module Easy
3
3
  module Cluster
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecs-easy-cluster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - metheglin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-25 00:00:00.000000000 Z
11
+ date: 2017-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk