From d10cf308ee096711421064dd412e98cbf452db8f Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 23 Sep 2024 14:00:48 -0700 Subject: [PATCH] Only send periodic warnings for stuff with a planned end date, i.e., VICE jobs --- analyses.go | 1 + 1 file changed, 1 insertion(+) diff --git a/analyses.go b/analyses.go index c303b84..fc415bc 100644 --- a/analyses.go +++ b/analyses.go @@ -184,6 +184,7 @@ SELECT jobs.id, JOIN users on jobs.user_id = users.id LEFT join notif_statuses ON jobs.id = notif_statuses.analysis_id WHERE jobs.status = $1 + AND jobs.planned_end_date > now() AND (notif_statuses.last_periodic_warning is null OR notif_statuses.last_periodic_warning < now() - coalesce(notif_statuses.periodic_warning_period, '4 hours'::interval)) `