@@ -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}`));
|
||||
|
||||
Referencia en una nueva incidencia
Block a user