Browse Source
Feature/add logging to benchmark service (#3654)
* Add logging
pull/3658/head
Thomas Kaul
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
0 deletions
-
apps/api/src/app/benchmark/benchmark.service.ts
|
|
@ -105,6 +105,8 @@ export class BenchmarkService { |
|
|
|
const { benchmarks, expiration }: BenchmarkValue = |
|
|
|
JSON.parse(cachedBenchmarkValue); |
|
|
|
|
|
|
|
Logger.debug('Fetched benchmarks from cache', 'BenchmarkService'); |
|
|
|
|
|
|
|
if (isAfter(new Date(), new Date(expiration))) { |
|
|
|
this.calculateAndCacheBenchmarks({ |
|
|
|
enableSharing |
|
|
@ -356,6 +358,8 @@ export class BenchmarkService { |
|
|
|
private async calculateAndCacheBenchmarks({ |
|
|
|
enableSharing = false |
|
|
|
}): Promise<BenchmarkResponse['benchmarks']> { |
|
|
|
Logger.debug('Calculate benchmarks', 'BenchmarkService'); |
|
|
|
|
|
|
|
const benchmarkAssetProfiles = await this.getBenchmarkAssetProfiles({ |
|
|
|
enableSharing |
|
|
|
}); |
|
|
|