Feature/expose portfolio snapshot computation timeout as environment variable (#3894)
* Expose portfolio snapshot computation timeout as environment variable * Update changelog
This commit is contained in:
parent
7a11bb93d5
commit
c44da0bce3
@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Exposed the timeout of the portfolio snapshot computation as an environment variable (`PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT`)
|
||||||
- Improved the portfolio unit tests to work with exported activity files
|
- Improved the portfolio unit tests to work with exported activity files
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@ -4,6 +4,7 @@ import {
|
|||||||
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE,
|
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE,
|
||||||
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA,
|
DEFAULT_PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA,
|
||||||
DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT,
|
DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT,
|
||||||
|
DEFAULT_PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT,
|
||||||
DEFAULT_ROOT_URL
|
DEFAULT_ROOT_URL
|
||||||
} from '@ghostfolio/common/config';
|
} from '@ghostfolio/common/config';
|
||||||
|
|
||||||
@ -59,6 +60,9 @@ export class ConfigurationService {
|
|||||||
PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT: num({
|
PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT: num({
|
||||||
default: DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT
|
default: DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT
|
||||||
}),
|
}),
|
||||||
|
PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT: num({
|
||||||
|
default: DEFAULT_PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT
|
||||||
|
}),
|
||||||
REDIS_DB: num({ default: 0 }),
|
REDIS_DB: num({ default: 0 }),
|
||||||
REDIS_HOST: str({ default: 'localhost' }),
|
REDIS_HOST: str({ default: 'localhost' }),
|
||||||
REDIS_PASSWORD: str({ default: '' }),
|
REDIS_PASSWORD: str({ default: '' }),
|
||||||
|
@ -8,7 +8,10 @@ import { DataProviderModule } from '@ghostfolio/api/services/data-provider/data-
|
|||||||
import { ExchangeRateDataModule } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.module';
|
import { ExchangeRateDataModule } from '@ghostfolio/api/services/exchange-rate-data/exchange-rate-data.module';
|
||||||
import { MarketDataModule } from '@ghostfolio/api/services/market-data/market-data.module';
|
import { MarketDataModule } from '@ghostfolio/api/services/market-data/market-data.module';
|
||||||
import { PortfolioSnapshotService } from '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service';
|
import { PortfolioSnapshotService } from '@ghostfolio/api/services/queues/portfolio-snapshot/portfolio-snapshot.service';
|
||||||
import { PORTFOLIO_SNAPSHOT_QUEUE } from '@ghostfolio/common/config';
|
import {
|
||||||
|
DEFAULT_PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT,
|
||||||
|
PORTFOLIO_SNAPSHOT_QUEUE
|
||||||
|
} from '@ghostfolio/common/config';
|
||||||
|
|
||||||
import { BullModule } from '@nestjs/bull';
|
import { BullModule } from '@nestjs/bull';
|
||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
@ -20,7 +23,14 @@ import { PortfolioSnapshotProcessor } from './portfolio-snapshot.processor';
|
|||||||
imports: [
|
imports: [
|
||||||
AccountBalanceModule,
|
AccountBalanceModule,
|
||||||
BullModule.registerQueue({
|
BullModule.registerQueue({
|
||||||
name: PORTFOLIO_SNAPSHOT_QUEUE
|
name: PORTFOLIO_SNAPSHOT_QUEUE,
|
||||||
|
settings: {
|
||||||
|
lockDuration: parseInt(
|
||||||
|
process.env.PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT ??
|
||||||
|
DEFAULT_PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT.toString(),
|
||||||
|
10
|
||||||
|
)
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
ConfigurationModule,
|
ConfigurationModule,
|
||||||
DataProviderModule,
|
DataProviderModule,
|
||||||
|
@ -51,6 +51,7 @@ export const DEFAULT_PAGE_SIZE = 50;
|
|||||||
export const DEFAULT_PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE = 1;
|
export const DEFAULT_PROCESSOR_CONCURRENCY_GATHER_ASSET_PROFILE = 1;
|
||||||
export const DEFAULT_PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA = 1;
|
export const DEFAULT_PROCESSOR_CONCURRENCY_GATHER_HISTORICAL_MARKET_DATA = 1;
|
||||||
export const DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT = 1;
|
export const DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT = 1;
|
||||||
|
export const DEFAULT_PROCESSOR_PORTFOLIO_SNAPSHOT_COMPUTATION_TIMEOUT = 30000;
|
||||||
export const DEFAULT_ROOT_URL = 'https://localhost:4200';
|
export const DEFAULT_ROOT_URL = 'https://localhost:4200';
|
||||||
|
|
||||||
// USX is handled separately
|
// USX is handled separately
|
||||||
|
Loading…
x
Reference in New Issue
Block a user