diff options
| author | Magnus Hagander | 2024-07-23 13:02:11 +0000 |
|---|---|---|
| committer | Magnus Hagander | 2024-07-23 13:02:11 +0000 |
| commit | d520de752dc4c4592eb1f258a58f5948a7254416 (patch) | |
| tree | ac4b3a45123148326c6463513f86789a6f4037a7 /postgresqleu | |
| parent | d70943d9469763819a4c9da67a9be20a19009a1c (diff) | |
Fix query for nagios alerts on unsent social media broadcasts
As of 45b8e2e9, we update the sent column to be True while leaving
unsent providers in the linked table (so we can keep track of which
succeeded and which failed). The nagios check never got the memo about
that one, so it didn't check the sent column, only the linked table,
when in fact it's now enough to *just* check the sent column. So do
that.
Diffstat (limited to 'postgresqleu')
| -rw-r--r-- | postgresqleu/util/monitor.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/postgresqleu/util/monitor.py b/postgresqleu/util/monitor.py index 691690ff..570681b7 100644 --- a/postgresqleu/util/monitor.py +++ b/postgresqleu/util/monitor.py @@ -76,7 +76,7 @@ def nagios(request): errors.append('Unsent notifications are present in the outbound queue') # Check that there are no outbound social media broadcasts in the queue - if exec_to_scalar("SELECT EXISTS (SELECT 1 FROM confreg_conferencetweetqueue tq WHERE datetime < now() - '10 minutes'::interval AND approved AND EXISTS (SELECT 1 FROM confreg_conferencetweetqueue_remainingtosend rts WHERE rts.conferencetweetqueue_id=tq.id))"): + if exec_to_scalar("SELECT EXISTS (SELECT 1 FROM confreg_conferencetweetqueue tq WHERE datetime < now() - '10 minutes'::interval AND approved AND NOT sent)"): errors.append('Unsent social media broadcasts are present in the outbound queue') # Check for email addresses not configured |
