|
@ -3,6 +3,8 @@ import { IDataGatheringItem } from '@ghostfolio/api/services/interfaces/interfac |
|
|
import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service'; |
|
|
import { MarketDataService } from '@ghostfolio/api/services/market-data/market-data.service'; |
|
|
import { |
|
|
import { |
|
|
DATA_GATHERING_QUEUE, |
|
|
DATA_GATHERING_QUEUE, |
|
|
|
|
|
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE, |
|
|
|
|
|
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA, |
|
|
GATHER_ASSET_PROFILE_PROCESS, |
|
|
GATHER_ASSET_PROFILE_PROCESS, |
|
|
GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_NAME |
|
|
GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_NAME |
|
|
} from '@ghostfolio/common/config'; |
|
|
} from '@ghostfolio/common/config'; |
|
@ -34,7 +36,14 @@ export class DataGatheringProcessor { |
|
|
private readonly marketDataService: MarketDataService |
|
|
private readonly marketDataService: MarketDataService |
|
|
) {} |
|
|
) {} |
|
|
|
|
|
|
|
|
@Process({ concurrency: 1, name: GATHER_ASSET_PROFILE_PROCESS }) |
|
|
@Process({ |
|
|
|
|
|
concurrency: parseInt( |
|
|
|
|
|
process.env.PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE ?? |
|
|
|
|
|
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE.toString(), |
|
|
|
|
|
10 |
|
|
|
|
|
), |
|
|
|
|
|
name: GATHER_ASSET_PROFILE_PROCESS |
|
|
|
|
|
}) |
|
|
public async gatherAssetProfile(job: Job<AssetProfileIdentifier>) { |
|
|
public async gatherAssetProfile(job: Job<AssetProfileIdentifier>) { |
|
|
try { |
|
|
try { |
|
|
Logger.log( |
|
|
Logger.log( |
|
@ -59,7 +68,11 @@ export class DataGatheringProcessor { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Process({ |
|
|
@Process({ |
|
|
concurrency: 1, |
|
|
concurrency: parseInt( |
|
|
|
|
|
process.env.PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA ?? |
|
|
|
|
|
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA.toString(), |
|
|
|
|
|
10 |
|
|
|
|
|
), |
|
|
name: GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_NAME |
|
|
name: GATHER_HISTORICAL_MARKET_DATA_PROCESS_JOB_NAME |
|
|
}) |
|
|
}) |
|
|
public async gatherHistoricalMarketData(job: Job<IDataGatheringItem>) { |
|
|
public async gatherHistoricalMarketData(job: Job<IDataGatheringItem>) { |
|
|