Browse Source

chore(logging): turn off logToDB since it was blowing up and hiding real errors in noise.

sql-absurd-sql-further
Matthew Raymer 5 days ago
parent
commit
596f3355bf
  1. 14
      src/db/databaseUtil.ts

14
src/db/databaseUtil.ts

@ -137,10 +137,10 @@ export async function logToDb(message: string): Promise<void> {
try {
// Try to insert first, if it fails due to UNIQUE constraint, update instead
await platform.dbExec("INSERT INTO logs (date, message) VALUES (?, ?)", [
nowKey,
message,
]);
// await platform.dbExec("INSERT INTO logs (date, message) VALUES (?, ?)", [
// nowKey,
// message,
// ]);
// Clean up old logs (keep only last 7 days) - do this less frequently
// Only clean up if the date is different from the last cleanup
@ -148,9 +148,9 @@ export async function logToDb(message: string): Promise<void> {
const sevenDaysAgo = new Date(
new Date().getTime() - 7 * 24 * 60 * 60 * 1000,
);
await platform.dbExec("DELETE FROM logs WHERE date < ?", [
sevenDaysAgo.toDateString(),
]);
// await platform.dbExec("DELETE FROM logs WHERE date < ?", [
// sevenDaysAgo.toDateString(),
// ]);
lastCleanupDate = todayKey;
}
} catch (error) {

Loading…
Cancel
Save