Feat : Control streamer
This commit is contained in:
@@ -103,6 +103,7 @@ class Hub {
|
||||
agentId: string,
|
||||
action: AgentAction,
|
||||
params?: Record<string, unknown>,
|
||||
timeoutMs = config.commandTimeoutMs,
|
||||
): Promise<unknown> {
|
||||
const connection = this.connections.get(agentId);
|
||||
if (!connection) throw new Error('Agent hors-ligne');
|
||||
@@ -114,7 +115,7 @@ class Hub {
|
||||
const timer = setTimeout(() => {
|
||||
connection.pending.delete(requestId);
|
||||
reject(new Error(`Timeout : l'agent n'a pas répondu à « ${action} »`));
|
||||
}, config.commandTimeoutMs);
|
||||
}, timeoutMs);
|
||||
|
||||
connection.pending.set(requestId, { resolve, reject, timer });
|
||||
|
||||
@@ -137,6 +138,7 @@ class Hub {
|
||||
obs: record.obs,
|
||||
autoConnectObs: record.autoConnectObs,
|
||||
watch: record.watch,
|
||||
browser: record.browser,
|
||||
};
|
||||
connection.socket.send(JSON.stringify(message));
|
||||
}
|
||||
@@ -174,6 +176,7 @@ class Hub {
|
||||
obs: { ...record.obs, password: record.obs.password ? '********' : '' },
|
||||
autoConnectObs: record.autoConnectObs,
|
||||
watch: record.watch,
|
||||
browser: record.browser,
|
||||
notes: record.notes,
|
||||
status: this.statusOf(record.id),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user