Comparing version 2.1.14 to 2.1.15
{ | ||
"name": "sqns", | ||
"version": "2.1.14", | ||
"version": "2.1.15", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -58,3 +58,3 @@ "use strict"; | ||
async findEventsToProcess(queues, time, limit) { | ||
const mongoDocuments = await this.connection.find(MongoDBAdapter.Table.Event, { | ||
const query = { | ||
queueARN: { $in: queues.map((queue) => queue.arn) }, | ||
@@ -64,3 +64,5 @@ eventTime: { $lt: time }, | ||
$expr: { $lt: ['$receiveCount', '$maxReceiveCount'] }, | ||
}, { eventTime: -1 }, { limit }); | ||
}; | ||
log.info('DB Fetch ', query); | ||
const mongoDocuments = await this.connection.find(MongoDBAdapter.Table.Event, query, { eventTime: -1 }, { limit }); | ||
return mongoDocuments.map((mongoDocument) => new event_item_1.EventItem(MongoDBAdapter.dbToSystemItem(mongoDocument))); | ||
@@ -67,0 +69,0 @@ } |
@@ -0,3 +1,3 @@ | ||
import { BASE_CONFIG, KeyValue } from '../../../../typings/common'; | ||
import { QueueStorageToQueueConfigListener } from '../../../../typings/config'; | ||
import { BASE_CONFIG, KeyValue } from '../../../../typings/typings'; | ||
import { Queue } from '../../common/model/queue'; | ||
@@ -9,2 +9,3 @@ export declare class QueueStorageToQueueConfig { | ||
private _queues; | ||
private _knownQueueARN; | ||
get sending(): boolean; | ||
@@ -18,3 +19,4 @@ set sending(value: boolean); | ||
set queues(value: Array<Queue>); | ||
get knownQueueARN(): KeyValue<boolean>; | ||
get cloneBaseParams(): KeyValue; | ||
} |
@@ -7,2 +7,4 @@ "use strict"; | ||
this._sending = false; | ||
this._queues = []; | ||
this._knownQueueARN = {}; | ||
} | ||
@@ -33,2 +35,5 @@ get sending() { | ||
} | ||
get knownQueueARN() { | ||
return this._knownQueueARN; | ||
} | ||
get cloneBaseParams() { | ||
@@ -35,0 +40,0 @@ if (typeof this.baseParams === 'function') { |
@@ -31,3 +31,3 @@ "use strict"; | ||
this.config.listener = listener; | ||
this.config.queues = [queue]; | ||
this.addQueue(queue); | ||
this.config.baseParams = baseParams; | ||
@@ -44,6 +44,7 @@ log.info(`Adding scheduler job for queueARN: ${queue.arn}`); | ||
addQueue(queue) { | ||
log.info(`Adding queueARN: ${queue.arn}`); | ||
if (this.config.queues.some((each) => each.arn === queue.arn)) { | ||
if (this.config.knownQueueARN[queue.arn]) { | ||
return; | ||
} | ||
log.info(`Adding queueARN: ${queue.arn}`); | ||
this.config.knownQueueARN[queue.arn] = true; | ||
this.config.queues.push(queue); | ||
@@ -50,0 +51,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
674442
8262