refactor: enhance command timeout logging and add keepalive ping handling for improved monitoring

This commit is contained in:
MayaTheShy
2026-02-20 04:39:52 -05:00
parent a809bddd46
commit 23515728e0
2 changed files with 11 additions and 0 deletions

View File

@@ -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);