diff options
Diffstat (limited to 'app/workers/environments/auto_stop_worker.rb')
-rw-r--r-- | app/workers/environments/auto_stop_worker.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/workers/environments/auto_stop_worker.rb b/app/workers/environments/auto_stop_worker.rb index 672a4f4121e..aee6e977550 100644 --- a/app/workers/environments/auto_stop_worker.rb +++ b/app/workers/environments/auto_stop_worker.rb @@ -10,8 +10,10 @@ module Environments def perform(environment_id, params = {}) Environment.find_by_id(environment_id).try do |environment| - user = environment.stop_action&.user - environment.stop_with_action!(user) + stop_actions = environment.stop_actions + + user = stop_actions.last&.user + environment.stop_with_actions!(user) end end end |