Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "aa-hooks", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Library for working with autonomous agent events", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -36,2 +36,3 @@ | ||
newEventsOnly: false, // default: false | ||
parallelProcessing: false // default: false | ||
}); | ||
@@ -38,0 +39,0 @@ |
@@ -14,2 +14,3 @@ const { v4: uuidv4 } = require('uuid'); | ||
newEventsOnly: false, | ||
parallelProcessing: false | ||
}; | ||
@@ -36,2 +37,3 @@ | ||
this.startTs = Math.floor(config.newEventsOnly ? new Date().getTime() / 1000 : 0); | ||
this.#parallelProcessing = config.parallelProcessing || false; | ||
@@ -111,4 +113,8 @@ eventBus.on('headless_wallet_ready', async () => { | ||
async #responseHandler(res) { | ||
const unlock = await mutex.lock('responseHandler'); | ||
let unlock; | ||
if (!this.#parallelProcessing) { | ||
unlock = await mutex.lock('responseHandler'); | ||
} | ||
if (res.timestamp >= this.startTs) { | ||
@@ -124,3 +130,5 @@ const eventId = await this.#findId(res); | ||
return await unlock(); | ||
if (unlock) { | ||
return await unlock(); | ||
} | ||
} | ||
@@ -127,0 +135,0 @@ } |
@@ -8,2 +8,3 @@ export class Hooks { | ||
newEventsOnly: boolean; | ||
parallelProcessing: boolean; | ||
}); | ||
@@ -10,0 +11,0 @@ /** @private */ |
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
117656
561
224