|
|
@ -265,12 +265,18 @@ export class DataGatheringService { |
|
|
'completed' |
|
|
'completed' |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const removeOnComplete = { |
|
|
|
|
|
age: GATHER_HISTORICAL_MARKET_DATA_COOLDOWN_IN_MS / 1000 |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
await this.gatherSymbols({ |
|
|
await this.gatherSymbols({ |
|
|
|
|
|
removeOnComplete, |
|
|
dataGatheringItems: await this.getCurrencies7D(), |
|
|
dataGatheringItems: await this.getCurrencies7D(), |
|
|
priority: DATA_GATHERING_QUEUE_PRIORITY_HIGH |
|
|
priority: DATA_GATHERING_QUEUE_PRIORITY_HIGH |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
await this.gatherSymbols({ |
|
|
await this.gatherSymbols({ |
|
|
|
|
|
removeOnComplete, |
|
|
dataGatheringItems: await this.getSymbols7D({ |
|
|
dataGatheringItems: await this.getSymbols7D({ |
|
|
withUserSubscription: true |
|
|
withUserSubscription: true |
|
|
}), |
|
|
}), |
|
|
@ -278,6 +284,7 @@ export class DataGatheringService { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
await this.gatherSymbols({ |
|
|
await this.gatherSymbols({ |
|
|
|
|
|
removeOnComplete, |
|
|
dataGatheringItems: await this.getSymbols7D({ |
|
|
dataGatheringItems: await this.getSymbols7D({ |
|
|
withUserSubscription: false |
|
|
withUserSubscription: false |
|
|
}), |
|
|
}), |
|
|
@ -350,11 +357,13 @@ export class DataGatheringService { |
|
|
public async gatherSymbols({ |
|
|
public async gatherSymbols({ |
|
|
dataGatheringItems, |
|
|
dataGatheringItems, |
|
|
force = false, |
|
|
force = false, |
|
|
priority |
|
|
priority, |
|
|
|
|
|
removeOnComplete = GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_OPTIONS.removeOnComplete |
|
|
}: { |
|
|
}: { |
|
|
dataGatheringItems: DataGatheringItem[]; |
|
|
dataGatheringItems: DataGatheringItem[]; |
|
|
force?: boolean; |
|
|
force?: boolean; |
|
|
priority: number; |
|
|
priority: number; |
|
|
|
|
|
removeOnComplete?: JobOptions['removeOnComplete']; |
|
|
}): Promise<Job[]> { |
|
|
}): Promise<Job[]> { |
|
|
return this.addJobsToQueue( |
|
|
return this.addJobsToQueue( |
|
|
dataGatheringItems.map(({ dataSource, date, symbol }) => { |
|
|
dataGatheringItems.map(({ dataSource, date, symbol }) => { |
|
|
@ -369,6 +378,7 @@ export class DataGatheringService { |
|
|
opts: { |
|
|
opts: { |
|
|
...GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_OPTIONS, |
|
|
...GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_OPTIONS, |
|
|
priority, |
|
|
priority, |
|
|
|
|
|
removeOnComplete, |
|
|
jobId: `${getAssetProfileIdentifier({ |
|
|
jobId: `${getAssetProfileIdentifier({ |
|
|
dataSource, |
|
|
dataSource, |
|
|
symbol |
|
|
symbol |
|
|
|