Browse Source

fix linting

pull/137/head
Trent Larson 1 week ago
parent
commit
ef3bfcdbd2
  1. 4
      src/db/databaseUtil.ts
  2. 2
      src/services/AbsurdSqlDatabaseService.ts
  3. 2
      src/utils/logger.ts

4
src/db/databaseUtil.ts

@ -145,7 +145,9 @@ export async function logToDb(message: string): Promise<void> {
// Clean up old logs (keep only last 7 days) - do this less frequently // 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 // Only clean up if the date is different from the last cleanup
if (!lastCleanupDate || lastCleanupDate !== todayKey) { if (!lastCleanupDate || lastCleanupDate !== todayKey) {
const sevenDaysAgo = new Date(new Date().getTime() - 7 * 24 * 60 * 60 * 1000); const sevenDaysAgo = new Date(
new Date().getTime() - 7 * 24 * 60 * 60 * 1000,
);
await platform.dbExec("DELETE FROM logs WHERE date < ?", [ await platform.dbExec("DELETE FROM logs WHERE date < ?", [
sevenDaysAgo.toDateString(), sevenDaysAgo.toDateString(),
]); ]);

2
src/services/AbsurdSqlDatabaseService.ts

@ -143,7 +143,7 @@ class AbsurdSqlDatabaseService implements DatabaseService {
} }
operation.resolve(result); operation.resolve(result);
} catch (error) { } catch (error) {
console.log( logger.error(
"Error while processing SQL queue:", "Error while processing SQL queue:",
error, error,
" ... for sql:", " ... for sql:",

2
src/utils/logger.ts

@ -24,7 +24,7 @@ export const logger = {
if (process.env.NODE_ENV !== "production") { if (process.env.NODE_ENV !== "production") {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.debug(message, ...args); console.debug(message, ...args);
const argsString = args.length > 0 ? " - " + safeStringify(args) : ""; // const argsString = args.length > 0 ? " - " + safeStringify(args) : "";
// logToDb(message + argsString); // logToDb(message + argsString);
} }
}, },

Loading…
Cancel
Save