summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-22 19:58:52 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-07-22 19:58:52 +1000
commit2a0b8cf9f5610ed2befa69cc60b65539db91f12e (patch)
tree517bfe3d8a977f02f16734fa8c100b07d86e9d07
parentTry using https raw instead of fetch? (diff)
downloadserver-2a0b8cf9f5610ed2befa69cc60b65539db91f12e.tar.xz
don't try to save undefined data in status
-rw-r--r--slowcord/status/src/index.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/slowcord/status/src/index.ts b/slowcord/status/src/index.ts
index ce393270..11298699 100644
--- a/slowcord/status/src/index.ts
+++ b/slowcord/status/src/index.ts
@@ -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) {