This commit is contained in:
Christian Fraß 2023-06-23 13:52:55 +02:00
parent 41c1551d7e
commit 75d85d8741
2 changed files with 5 additions and 2 deletions

View file

@ -323,7 +323,10 @@ async function main(
// TODO: type // TODO: type
let old_item_state : (null | _heimdall.type_item_state); let old_item_state : (null | _heimdall.type_item_state);
let last_notification_timestamp : (null | int); const last_notification_timestamp : (null | int) = await _heimdall.state_repository.get_last_notification_timestamp(
database_path,
check.name
);
if (rows.length <= 0) { if (rows.length <= 0) {
old_item_state = null; old_item_state = null;

View file

@ -119,7 +119,7 @@ namespace _heimdall.state_repository
const rows : Array<Array<any>> = await _heimdall.helpers.sqlite.query_get( const rows : Array<Array<any>> = await _heimdall.helpers.sqlite.query_get(
database_path, database_path,
{ {
"template": "SELECT MIN(timestamp) FROM results WHERE (check_name = :check_name) AND (notification_sent = TRUE);", "template": "SELECT MAX(timestamp) FROM results WHERE (check_name = :check_name) AND (notification_sent = TRUE);",
"arguments": { "arguments": {
"check_name": check_name, "check_name": check_name,
}, },