Skip to content

Commit 4fa09ba

Browse files
authored
Fix auto-unshelve by housekeeping (alerta#988)
1 parent 51d1580 commit 4fa09ba

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

alerta/database/backends/mongodb/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ def housekeeping(self, expired_threshold, info_threshold):
15921592
{'$match': {'status': 'shelved'}},
15931593
{'$unwind': '$history'},
15941594
{'$match': {
1595-
'history.type': 'action',
1595+
'history.type': 'shelve',
15961596
'history.status': 'shelved'
15971597
}},
15981598
{'$sort': {'history.updateTime': -1}},

alerta/database/backends/postgres/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ def housekeeping(self, expired_threshold, info_threshold):
12521252
SELECT DISTINCT ON (a.id) a.id, a.event, a.last_receive_id, h.update_time, a.timeout
12531253
FROM alerts a, UNNEST(history) h
12541254
WHERE a.status='shelved'
1255-
AND h.type='action'
1255+
AND h.type='shelve'
12561256
AND h.status='shelved'
12571257
ORDER BY a.id, h.update_time DESC
12581258
)

0 commit comments

Comments
 (0)