initial setup with operation tracker

This commit is contained in:
Boki 2025-06-28 12:27:50 -04:00
parent d52cfe7de2
commit 736b86e66a
5 changed files with 92 additions and 89 deletions

View file

@ -3,8 +3,8 @@
* Supports dynamic operation registration with auto-indexing
*/
import type { Logger } from '@stock-bot/types';
import type { MongoDBClient } from '@stock-bot/mongodb';
import type { Logger } from '@stock-bot/types';
import type { IntradayCrawlSymbol, QMOperationConfig } from './types';
export class QMOperationTracker {
@ -140,7 +140,7 @@ export class QMOperationTracker {
};
}>
): Promise<void> {
if (updates.length === 0) return;
if (updates.length === 0) {return;}
const bulkOps = updates.map(({ symbol, operation, data }) => {
const update: any = {
@ -180,7 +180,7 @@ export class QMOperationTracker {
this.logger.debug('Bulk updated symbol operations', {
totalUpdates: updates.length,
modified: result.modifiedCount,
operations: [...new Set(updates.map(u => u.operation))]
operations: Array.from(new Set(updates.map(u => u.operation)))
});
}