diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f194b23a..41f5aa5c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- If historical data is not complete at the time the performance chart is generated, start a background task to refresh historical data. +- Default build environment to production state + ## 1.265.0 - 2023-05-01 ### Changed diff --git a/apps/api/src/app/portfolio/current-rate.service.ts b/apps/api/src/app/portfolio/current-rate.service.ts index 6d48573f7..94e74fc66 100644 --- a/apps/api/src/app/portfolio/current-rate.service.ts +++ b/apps/api/src/app/portfolio/current-rate.service.ts @@ -10,11 +10,13 @@ import { flatten, isEmpty, uniqBy } from 'lodash'; import { GetValueObject } from './interfaces/get-value-object.interface'; import { GetValuesObject } from './interfaces/get-values-object.interface'; import { GetValuesParams } from './interfaces/get-values-params.interface'; +import { DataGatheringService } from '@ghostfolio/api/services/data-gathering/data-gathering.service'; @Injectable() export class CurrentRateService { public constructor( private readonly dataProviderService: DataProviderService, + private readonly dataGatheringService: DataGatheringService, private readonly exchangeRateDataService: ExchangeRateDataService, private readonly marketDataService: MarketDataService ) {} @@ -68,6 +70,10 @@ export class CurrentRateService { symbol: dataGatheringItem.symbol }); } + if (result.length == 1) { + // getValues result of size 1 ("today only") means historical data is not + // synchromized. Queue up sync so that a refresh would pull more historical data. + this.dataGatheringService.gather7Days(); } return result; @@ -165,4 +171,4 @@ export class CurrentRateService { } return false; } -} +} \ No newline at end of file diff --git a/apps/api/src/environments/environment.ts b/apps/api/src/environments/environment.ts index c0ae2e7e5..9a5d72254 100644 --- a/apps/api/src/environments/environment.ts +++ b/apps/api/src/environments/environment.ts @@ -1,4 +1,4 @@ export const environment = { - production: false, - version: 'dev' + production: true, + version: 'production' };