mirror of
https://github.com/Evolix/chexpire.git
synced 2024-06-05 09:04:29 +02:00
CheckProcessor: restrict scope to "auto" checks
This commit is contained in:
parent
6ccddc6afc
commit
7a7ef4407b
|
@ -54,6 +54,7 @@ module CheckProcessor
|
||||||
def base_scope
|
def base_scope
|
||||||
Check
|
Check
|
||||||
.active
|
.active
|
||||||
|
.auto
|
||||||
.where("last_run_at IS NULL OR last_run_at < DATE_SUB(NOW(), INTERVAL 12 HOUR)")
|
.where("last_run_at IS NULL OR last_run_at < DATE_SUB(NOW(), INTERVAL 12 HOUR)")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,16 @@ class CheckProcessorTest < ActiveSupport::TestCase
|
||||||
assert_not_includes checks, c2
|
assert_not_includes checks, c2
|
||||||
end
|
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
|
test "#sync_dates respects the interval configuration between sends" do
|
||||||
create_list(:check, 3, :expires_next_week)
|
create_list(:check, 3, :expires_next_week)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue