FIX: Ensure scheduled problem checks honor perform_every configuration (#35291)

When running scheduled problem checks (which happens every 10 minutes), it uses the next_run_at to see if enough time has passed to check again. This causes the check to run every 10 minutes, regardless of its perform_every config.

This timestamp isn't getting updated when the problem check passed without detecting any problems. (It works correctly when there are problems.)
This commit is contained in:
Ted Johansson
2025-10-09 15:04:46 +08:00
committed by GitHub
parent 4bcf875dcb
commit 2e60af3ad8
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -231,6 +231,8 @@ RSpec.describe ProblemCheckTracker do
end
describe "#no_problem!" do
let(:next_run_at) { 24.hours.from_now.round(6) }
let(:problem_tracker) do
Fabricate(:problem_check_tracker, identifier: "twitter_login", **original_attributes)
end
@@ -245,12 +247,12 @@ RSpec.describe ProblemCheckTracker do
}
end
let(:updated_attributes) { { blips: 0 } }
let(:updated_attributes) { { blips: 0, next_run_at: } }
it do
freeze_time
expect { problem_tracker.no_problem!(next_run_at: 24.hours.from_now) }.to change {
expect { problem_tracker.no_problem!(next_run_at:) }.to change {
problem_tracker.attributes
}.to(hash_including(updated_attributes))
end