[add] state_repository:get_last_notification_timestamp
This commit is contained in:
parent
4a1a77ba99
commit
40976759e7
|
|
@ -109,6 +109,27 @@ namespace _heimdall.state_repository
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
export function get_last_notification_timestamp(
|
||||
database_path : string
|
||||
check_name : string
|
||||
) : Promise<(null | int)>
|
||||
{
|
||||
const rows : Array<Array<any>> = await _heimdall.helpers.sqlite.query_get(
|
||||
database_path,
|
||||
{
|
||||
"template": "SELECT MIN(timestamp) FROM results WHERE (check_name = :check_name) AND (notification_sent = TRUE);",
|
||||
"arguments": {
|
||||
"check_name": check_name,
|
||||
"limit": threshold,
|
||||
},
|
||||
}
|
||||
);
|
||||
return rows[0][0];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*/
|
||||
export async function feed(
|
||||
|
|
|
|||
Loading…
Reference in a new issue