mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
Feature #2118: Add cooldown time after a set-cardinality action
This commit is contained in:
1 parent
dafe3cd58a
commit
bf0245d17c
2 files changed
+7
No files matched your search
@@ -730,6 +730,11 @@ module OpenNebula
|
||||
@body['cooldown_duration'] = cooldown_duration.to_i
|
||||
end
|
||||
|
||||
# Updates the duration for the next cooldown with the default value
|
||||
def set_default_cooldown_duration()
|
||||
set_cooldown_duration(@body['cooldown'].to_i)
|
||||
end
|
||||
|
||||
# Sets the cooldown end time from now + the duration set in set_cooldown_duration
|
||||
# @return [true, false] true if the cooldown duration is bigger than 0
|
||||
def apply_cooldown_duration()
|
||||
|
||||
@@ -345,6 +345,8 @@ module OpenNebula
|
||||
|
||||
role.set_state(Role::STATE['SCALING'])
|
||||
|
||||
role.set_default_cooldown_duration()
|
||||
|
||||
self.set_state(Service::STATE['SCALING'])
|
||||
return self.update
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user