added deduplication and exchange stats
This commit is contained in:
parent
133f37e755
commit
100efb575f
7 changed files with 309 additions and 6 deletions
|
|
@ -217,6 +217,7 @@ export class QMOperationTracker {
|
|||
})();
|
||||
|
||||
const filter: any = {
|
||||
active: { $ne: false }, // Only active symbols (active: true or active doesn't exist)
|
||||
$or: [
|
||||
{ [`operations.${operationName}.lastSuccessAt`]: { $lt: cutoffDate } },
|
||||
{ [`operations.${operationName}.lastSuccessAt`]: { $exists: false } },
|
||||
|
|
@ -249,7 +250,9 @@ export class QMOperationTracker {
|
|||
): Promise<IntradayCrawlSymbol[]> {
|
||||
const { limit = 100, includeFinished = false } = options;
|
||||
|
||||
const filter: any = {};
|
||||
const filter: any = {
|
||||
active: { $ne: false } // Only active symbols
|
||||
};
|
||||
if (!includeFinished) {
|
||||
filter[`operations.${operationName}.crawlState.finished`] = { $ne: true };
|
||||
}
|
||||
|
|
@ -308,7 +311,9 @@ export class QMOperationTracker {
|
|||
} = {}
|
||||
): Promise<Array<{ qmSearchCode: string; lastRecordDate?: Date }>> {
|
||||
const { limit = 500 } = options;
|
||||
const filter: any = {};
|
||||
const filter: any = {
|
||||
active: { $ne: false } // Only active symbols
|
||||
};
|
||||
|
||||
if (options.neverRun) {
|
||||
filter[`operations.${operationName}`] = { $exists: false };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue