Skip to content

Commit 8d6f4e8

Browse files
authored
GHI-8735: Stale instance after auto-scaling (#143)
* GHI-8735: fail-safe server remoival in case of race condition * GHI-8735: version bump
1 parent a7d82d3 commit 8d6f4e8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ey-core/models/server.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def save!
134134
end
135135

136136
def destroy!(skip_snapshot="false")
137-
if environment.servers.count == 1
137+
if environment.servers.reject { |server| server.id == self.id }.count == 0
138138
raise Ey::Core::Client::NotPermitted, "Terminating the last server in an environment is not allowed. You must deprovision or destroy the environment instead."
139139
end
140140

lib/ey-core/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Ey
22
module Core
3-
VERSION = "3.6.6"
3+
VERSION = "3.6.7"
44
end
55
end

0 commit comments

Comments
 (0)