switched all console logs to logger
This commit is contained in:
parent
3877902ff4
commit
a3f2f199b4
14 changed files with 125 additions and 122 deletions
|
|
@ -14,6 +14,7 @@ import type {
|
|||
ShutdownOptions,
|
||||
ShutdownResult,
|
||||
} from './types';
|
||||
import { getLogger } from '@stock-bot/logger';
|
||||
|
||||
// Global flag that works across all processes/workers
|
||||
declare global {
|
||||
|
|
@ -22,6 +23,7 @@ declare global {
|
|||
|
||||
export class Shutdown {
|
||||
private static instance: Shutdown | null = null;
|
||||
private readonly logger = getLogger('shutdown');
|
||||
private isShuttingDown = false;
|
||||
private signalReceived = false; // Track if shutdown signal was received
|
||||
private shutdownTimeout = 30000; // 30 seconds default
|
||||
|
|
@ -200,7 +202,7 @@ export class Shutdown {
|
|||
} catch (error) {
|
||||
failed++;
|
||||
if (name) {
|
||||
console.error(`✗ Shutdown failed: ${name} (priority: ${priority})`, error);
|
||||
this.logger.error(`Shutdown failed: ${name} (priority: ${priority})`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue