|
@ -37,7 +37,17 @@ export class DataGatheringProcessor { |
|
|
@Process({ concurrency: 1, name: GATHER_ASSET_PROFILE_PROCESS }) |
|
|
@Process({ concurrency: 1, name: GATHER_ASSET_PROFILE_PROCESS }) |
|
|
public async gatherAssetProfile(job: Job<UniqueAsset>) { |
|
|
public async gatherAssetProfile(job: Job<UniqueAsset>) { |
|
|
try { |
|
|
try { |
|
|
|
|
|
Logger.log( |
|
|
|
|
|
`Asset profile data gathering has been started for ${job.data.symbol} (${job.data.dataSource})`, |
|
|
|
|
|
`DataGatheringProcessor (${GATHER_ASSET_PROFILE_PROCESS})` |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
await this.dataGatheringService.gatherAssetProfiles([job.data]); |
|
|
await this.dataGatheringService.gatherAssetProfiles([job.data]); |
|
|
|
|
|
|
|
|
|
|
|
Logger.log( |
|
|
|
|
|
`Asset profile data gathering has been completed for ${job.data.symbol} (${job.data.dataSource})`, |
|
|
|
|
|
`DataGatheringProcessor (${GATHER_ASSET_PROFILE_PROCESS})` |
|
|
|
|
|
); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
Logger.error( |
|
|
Logger.error( |
|
|
error, |
|
|
error, |
|
@ -62,11 +72,11 @@ export class DataGatheringProcessor { |
|
|
`DataGatheringProcessor (${GATHER_HISTORICAL_MARKET_DATA_PROCESS})` |
|
|
`DataGatheringProcessor (${GATHER_HISTORICAL_MARKET_DATA_PROCESS})` |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
const historicalData = await this.dataProviderService.getHistoricalRaw( |
|
|
const historicalData = await this.dataProviderService.getHistoricalRaw({ |
|
|
[{ dataSource, symbol }], |
|
|
dataGatheringItems: [{ dataSource, symbol }], |
|
|
currentDate, |
|
|
from: currentDate, |
|
|
new Date() |
|
|
to: new Date() |
|
|
); |
|
|
}); |
|
|
|
|
|
|
|
|
const data: Prisma.MarketDataUpdateInput[] = []; |
|
|
const data: Prisma.MarketDataUpdateInput[] = []; |
|
|
let lastMarketPrice: number; |
|
|
let lastMarketPrice: number; |
|
|