Browse Source

If historical data is not complete at the time the performance chart is generated, start a background task to refresh historical data.

pull/1924/head
Oleg Shvartsman 2 years ago
parent
commit
5ffe3f4f34
  1. 7
      CHANGELOG.md
  2. 8
      apps/api/src/app/portfolio/current-rate.service.ts
  3. 4
      apps/api/src/environments/environment.ts

7
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

8
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;
}
}
}

4
apps/api/src/environments/environment.ts

@ -1,4 +1,4 @@
export const environment = {
production: false,
version: 'dev'
production: true,
version: 'production'
};

Loading…
Cancel
Save