Small improvement
This commit is contained in:
parent
599264b362
commit
04e081c31a
@ -11,7 +11,6 @@ export class ConsoleManager {
|
||||
private readonly registry: CommandRegistry
|
||||
private readonly prompt: ConsolePrompt
|
||||
private readonly logReader: LogReader
|
||||
private io: Server | null = null
|
||||
|
||||
constructor() {
|
||||
this.registry = new CommandRegistry()
|
||||
@ -21,8 +20,6 @@ export class ConsoleManager {
|
||||
}
|
||||
|
||||
public async boot(): Promise<void> {
|
||||
this.io = SocketManager.getIO()
|
||||
|
||||
await this.registry.loadCommands()
|
||||
this.logReader.start()
|
||||
this.prompt.start()
|
||||
@ -45,7 +42,7 @@ export class ConsoleManager {
|
||||
}
|
||||
|
||||
try {
|
||||
const commandInstance = new CommandClass(this.io as Server)
|
||||
const commandInstance = new CommandClass(SocketManager.getIO())
|
||||
await commandInstance.execute(args)
|
||||
} catch (error) {
|
||||
this.logger.error(`Error executing command ${cmd}: ${error instanceof Error ? error.message : String(error)}`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user