@orml/dispatcher
Advanced tools
Comparing version 0.2.0-beta.63 to 0.2.0-beta.64
@@ -9,2 +9,3 @@ export interface DispatchEvent { | ||
maxConcurrentCount: number; | ||
timeout: number; | ||
} | ||
@@ -11,0 +12,0 @@ export declare class DispatchEventHandler<T extends DispatchEvent = DispatchEvent> { |
@@ -21,3 +21,5 @@ "use strict"; | ||
const defaultDispatchEventHandlerOptions = { | ||
maxConcurrentCount: 1000 | ||
maxConcurrentCount: 100, | ||
timeout: 1000 * 60 * 5 // 5 mins | ||
}; | ||
@@ -92,3 +94,6 @@ | ||
try { | ||
await handler.callback(event); | ||
await new Promise((resolve, reject) => { | ||
resolve(handler.callback(event)); | ||
setTimeout(() => reject(new Error('Handler timeouted')), handler.options.timeout); | ||
}); | ||
} catch (error) { | ||
@@ -95,0 +100,0 @@ logger.warn('callHandler', 'failed', { |
{ | ||
"name": "@orml/dispatcher", | ||
"version": "0.2.0-beta.63", | ||
"version": "0.2.0-beta.64", | ||
"description": "ORML JS API", | ||
@@ -19,4 +19,4 @@ "main": "index.js", | ||
"@babel/runtime": "^7.8.4", | ||
"@orml/util": "^0.2.0-beta.63" | ||
"@orml/util": "^0.2.0-beta.64" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28371
463
Updated@orml/util@^0.2.0-beta.64