mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 05:55:39 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user