mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-23 10:52:30 +01:00
don't try to save undefined data in status
This commit is contained in:
parent
b16930f560
commit
c5468128f9
@ -42,7 +42,7 @@ client.on("warn", (msg) => {
|
||||
const savePerf = async (time: number, name: string, error?: string | Error) => {
|
||||
if (error && typeof error != "string") error = error.message;
|
||||
try {
|
||||
await executePromise("INSERT INTO performance (value, endpoint, timestamp, error) VALUES (?, ?, ?, ?)", [time, name, new Date(), error ?? null]);
|
||||
await executePromise("INSERT INTO performance (value, endpoint, timestamp, error) VALUES (?, ?, ?, ?)", [time ?? 0, name, new Date(), error ?? null]);
|
||||
await executePromise("DELETE FROM performance WHERE DATE(timestamp) < now() - interval ? DAY", [process.env.RETENTION_DAYS]);
|
||||
}
|
||||
catch (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user