Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-10-08 05:24:12 +02:00
padre 8caca27b22
commit 268914def2
Se han modificado 2 ficheros con 21 adiciones y 3 borrados

Ver fichero

@@ -172,8 +172,16 @@ export class PythonBridge extends EventEmitter {
const requestId = Math.random().toString(36).substring(2, 15);
const request = { command, data, requestId };
// Set timeout - longer for target operations
const timeoutDuration = command === 'set_target' ? 10000 : 30000; // 10s for set_target, 30s for others
// Set timeout based on command complexity
let timeoutDuration = 5000; // Default 5s
if (command === 'set_target') {
timeoutDuration = 10000; // 10s for target operations
} else if (['sample', 'observe', 'get_state'].includes(command)) {
timeoutDuration = 15000; // 15s for quantum operations
} else if (['get_platform_info', 'get_available_targets', 'list_kernels'].includes(command)) {
timeoutDuration = 3000; // 3s for simple info operations
}
const timeout = setTimeout(() => {
this.requestQueue.delete(requestId);
reject(new Error(`Python command timeout: ${command}`));