diff --git a/app/services/check_processor.rb b/app/services/check_processor.rb index 37226b5..2cc626b 100644 --- a/app/services/check_processor.rb +++ b/app/services/check_processor.rb @@ -54,6 +54,7 @@ module CheckProcessor def base_scope Check .active + .auto .where("last_run_at IS NULL OR last_run_at < DATE_SUB(NOW(), INTERVAL 12 HOUR)") end diff --git a/test/services/check_processor_test.rb b/test/services/check_processor_test.rb index 876f8d5..b85191c 100644 --- a/test/services/check_processor_test.rb +++ b/test/services/check_processor_test.rb @@ -108,6 +108,16 @@ class CheckProcessorTest < ActiveSupport::TestCase assert_not_includes checks, c2 end + test "resolvers does not include manual checks" do + c1 = create(:check, :expires_next_week) + c2 = create(:check, :expires_next_week, domain: "fff.wxyz") + + checks = @processor.resolve_expire_short_term + + assert_includes checks, c1 + assert_not_includes checks, c2 + end + test "#sync_dates respects the interval configuration between sends" do create_list(:check, 3, :expires_next_week)