mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
adding ability to record logs for debug purposes
This commit is contained in:
7
index.js
7
index.js
@@ -10,6 +10,7 @@ import { runMigrations } from './lib/services/storage/migrations/migrate.js';
|
||||
import { ensureDemoUserExists, ensureAdminUserExists } from './lib/services/storage/userStorage.js';
|
||||
import { initTrackerCron } from './lib/services/crons/tracker-cron.js';
|
||||
import logger from './lib/services/logger.js';
|
||||
import { reloadEnabledFromSettings } from './lib/services/debug/debugLogStorage.js';
|
||||
import { initActiveCheckerCron } from './lib/services/crons/listing-alive-cron.js';
|
||||
import { initGeocodingCron } from './lib/services/crons/geocoding-cron.js';
|
||||
import { getSettings } from './lib/services/storage/settingsStorage.js';
|
||||
@@ -42,6 +43,12 @@ await runMigrations();
|
||||
|
||||
const settings = await getSettings();
|
||||
|
||||
// Restore the persisted on/off flag for opt-in DB log capture so it survives a
|
||||
// Fredy restart. reloadEnabledFromSettings() also (un)wires the logger sink based
|
||||
// on the restored flag, so the logger hot path stays cost-free when nobody enabled
|
||||
// the feature.
|
||||
await reloadEnabledFromSettings();
|
||||
|
||||
// Ensure the sqlite directory exists before loading anything else (based on config.sqlitepath)
|
||||
const { dir: sqliteDir } = await computeDbPath();
|
||||
if (!fs.existsSync(sqliteDir)) {
|
||||
|
||||
Reference in New Issue
Block a user