From 3542fb0fc091d1cbe7773d174d795ed4a8fe88f0 Mon Sep 17 00:00:00 2001 From: Nick Schwaderer Date: Fri, 8 Dec 2023 13:59:04 +0000 Subject: [PATCH] Don't set ended_at when pausing stuck runs (#929) --- app/models/maintenance_tasks/run.rb | 1 - test/models/maintenance_tasks/run_test.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/app/models/maintenance_tasks/run.rb b/app/models/maintenance_tasks/run.rb index 1774f718..bc9249f3 100644 --- a/app/models/maintenance_tasks/run.rb +++ b/app/models/maintenance_tasks/run.rb @@ -328,7 +328,6 @@ def cancel def pause if stuck? self.status = :paused - self.ended_at = Time.now persist_transition else pausing! diff --git a/test/models/maintenance_tasks/run_test.rb b/test/models/maintenance_tasks/run_test.rb index 3ee0bffe..3ae848e8 100644 --- a/test/models/maintenance_tasks/run_test.rb +++ b/test/models/maintenance_tasks/run_test.rb @@ -649,7 +649,6 @@ class RunTest < ActiveSupport::TestCase travel Run::STUCK_TASK_TIMEOUT run.pause assert_predicate run, :paused? - assert_equal Time.now, run.ended_at end test "#persist_error rescues and retries ActiveRecord::StaleObjectError" do