refactor: enhance command timeout logging and add keepalive ping handling for improved monitoring
This commit is contained in:
@@ -358,6 +358,10 @@ export class Turtle extends EventEmitter {
|
||||
|
||||
// Set up timeout
|
||||
const timer = setTimeout(() => {
|
||||
const pending = this._pendingCommands.get(uuid);
|
||||
if (pending) {
|
||||
console.warn(`[Turtle ${this.id}] ⏰ Command timed out uuid:${uuid.substring(0, 8)} (pending: ${this._pendingCommands.size}, code: ${luaCode.substring(0, 50)})`);
|
||||
}
|
||||
this._pendingCommands.delete(uuid);
|
||||
reject(new Error(`Command timed out after ${timeout}ms`));
|
||||
}, timeout);
|
||||
|
||||
Reference in New Issue
Block a user