Refactor logging and improve service initialization
- Updated logging in `search-server.ts` to use `silentDebug` for non-critical messages, reducing console noise. - Added a health check endpoint in `worker-service.ts` to improve service monitoring. - Modified the worker service startup process to start the HTTP server immediately and perform slow initialization in the background. - Refactored database initialization in `Database.ts` to use the correct `Database` class. - Implemented a port availability check in `context-hook.ts` to ensure the worker service is ready before making requests.
This commit is contained in:
@@ -44,7 +44,7 @@ export class DatabaseManager {
|
||||
// Ensure the data directory exists
|
||||
ensureDir(DATA_DIR);
|
||||
|
||||
this.db = new BunDatabase(DB_PATH, { create: true, readwrite: true });
|
||||
this.db = new Database(DB_PATH, { create: true, readwrite: true });
|
||||
|
||||
// Apply optimized SQLite settings
|
||||
this.db.run('PRAGMA journal_mode = WAL');
|
||||
@@ -168,4 +168,4 @@ export async function initializeDatabase(): Promise<Database> {
|
||||
return await manager.initialize();
|
||||
}
|
||||
|
||||
export { BunDatabase as Database };
|
||||
export { Database };
|
||||
Reference in New Issue
Block a user