Feature/expose concurrency of portfolio snapshot calculation as environment variable (#3796)
* Expose PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT * Update changelog
This commit is contained in:
parent
5e4201d831
commit
e918970feb
@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Improved the usability of the create or update access dialog
|
- Improved the usability of the create or update access dialog
|
||||||
- Improved the loading indicator of the accounts table
|
- Improved the loading indicator of the accounts table
|
||||||
|
- Exposed the concurrency of the portfolio snapshot calculation as an environment variable (`PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT`)
|
||||||
- Improved the language localization for German (`de`)
|
- Improved the language localization for German (`de`)
|
||||||
- Improved the language localization for Polish (`pl`)
|
- Improved the language localization for Polish (`pl`)
|
||||||
- Upgraded `prisma` from version `5.19.0` to `5.19.1`
|
- Upgraded `prisma` from version `5.19.0` to `5.19.1`
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Environment } from '@ghostfolio/api/services/interfaces/environment.interface';
|
import { Environment } from '@ghostfolio/api/services/interfaces/environment.interface';
|
||||||
import {
|
import {
|
||||||
CACHE_TTL_NO_CACHE,
|
CACHE_TTL_NO_CACHE,
|
||||||
|
DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT,
|
||||||
DEFAULT_ROOT_URL
|
DEFAULT_ROOT_URL
|
||||||
} from '@ghostfolio/common/config';
|
} from '@ghostfolio/common/config';
|
||||||
|
|
||||||
@ -47,6 +48,9 @@ export class ConfigurationService {
|
|||||||
MAX_ACTIVITIES_TO_IMPORT: num({ default: Number.MAX_SAFE_INTEGER }),
|
MAX_ACTIVITIES_TO_IMPORT: num({ default: Number.MAX_SAFE_INTEGER }),
|
||||||
MAX_CHART_ITEMS: num({ default: 365 }),
|
MAX_CHART_ITEMS: num({ default: 365 }),
|
||||||
PORT: port({ default: 3333 }),
|
PORT: port({ default: 3333 }),
|
||||||
|
PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT: num({
|
||||||
|
default: DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT
|
||||||
|
}),
|
||||||
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,6 +8,7 @@ import { RedisCacheService } from '@ghostfolio/api/app/redis-cache/redis-cache.s
|
|||||||
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
|
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
|
||||||
import {
|
import {
|
||||||
CACHE_TTL_INFINITE,
|
CACHE_TTL_INFINITE,
|
||||||
|
DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT,
|
||||||
PORTFOLIO_SNAPSHOT_PROCESS_JOB_NAME,
|
PORTFOLIO_SNAPSHOT_PROCESS_JOB_NAME,
|
||||||
PORTFOLIO_SNAPSHOT_QUEUE
|
PORTFOLIO_SNAPSHOT_QUEUE
|
||||||
} from '@ghostfolio/common/config';
|
} from '@ghostfolio/common/config';
|
||||||
@ -29,7 +30,14 @@ export class PortfolioSnapshotProcessor {
|
|||||||
private readonly redisCacheService: RedisCacheService
|
private readonly redisCacheService: RedisCacheService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@Process({ concurrency: 1, name: PORTFOLIO_SNAPSHOT_PROCESS_JOB_NAME })
|
@Process({
|
||||||
|
concurrency: parseInt(
|
||||||
|
process.env.PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT ??
|
||||||
|
DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT.toString(),
|
||||||
|
10
|
||||||
|
),
|
||||||
|
name: PORTFOLIO_SNAPSHOT_PROCESS_JOB_NAME
|
||||||
|
})
|
||||||
public async calculatePortfolioSnapshot(
|
public async calculatePortfolioSnapshot(
|
||||||
job: Job<IPortfolioSnapshotQueueJob>
|
job: Job<IPortfolioSnapshotQueueJob>
|
||||||
) {
|
) {
|
||||||
|
@ -48,6 +48,7 @@ export const DEFAULT_CURRENCY = 'USD';
|
|||||||
export const DEFAULT_DATE_FORMAT_MONTH_YEAR = 'MMM yyyy';
|
export const DEFAULT_DATE_FORMAT_MONTH_YEAR = 'MMM yyyy';
|
||||||
export const DEFAULT_LANGUAGE_CODE = 'en';
|
export const DEFAULT_LANGUAGE_CODE = 'en';
|
||||||
export const DEFAULT_PAGE_SIZE = 50;
|
export const DEFAULT_PAGE_SIZE = 50;
|
||||||
|
export const DEFAULT_PROCESSOR_CONCURRENCY_PORTFOLIO_SNAPSHOT = 1;
|
||||||
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