fix(xen-api/_watchEvents): pTimeout expects milliseconds

This commit is contained in:
Julien Fontanet 2019-03-01 13:40:03 +01:00
parent 7c5d90fe40
commit fe0dcbacc5

View File

@ -37,7 +37,7 @@ const debug = createDebug('xen-api')
// =================================================================== // ===================================================================
// in seconds // in seconds!
const EVENT_TIMEOUT = 60 const EVENT_TIMEOUT = 60
// http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html // http://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
@ -1020,7 +1020,7 @@ export class Xapi extends EventEmitter {
result = await this._sessionCall( result = await this._sessionCall(
'event.from', 'event.from',
[types, fromToken, EVENT_TIMEOUT], [types, fromToken, EVENT_TIMEOUT],
EVENT_TIMEOUT * 1.1 EVENT_TIMEOUT * 1e3 * 1.1
) )
} catch (error) { } catch (error) {
if (error instanceof TimeoutError) { if (error instanceof TimeoutError) {