File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/frequenz/sdk/timeseries/formula_engine Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -432,13 +432,13 @@ async def _fetch_from_fallback(
432432
433433 async def _synchronize_and_fetch_fallback (
434434 self ,
435- primary_fetcher_sample : Sample [QuantityT ],
435+ primary_fetcher_value : Sample [QuantityT ] | None ,
436436 fallback_fetcher : FallbackMetricFetcher [QuantityT ],
437437 ) -> Sample [QuantityT ] | None :
438438 """Synchronize the fallback fetcher and return the fallback value.
439439
440440 Args:
441- primary_fetcher_sample : The sample fetched from the primary fetcher.
441+ primary_fetcher_value : The sample fetched from the primary fetcher.
442442 fallback_fetcher: The fallback metric fetcher.
443443
444444 Returns:
@@ -454,14 +454,14 @@ async def _synchronize_and_fetch_fallback(
454454 fallback_fetcher
455455 )
456456
457- if self ._latest_fallback_sample is None :
457+ if primary_fetcher_value is None or self ._latest_fallback_sample is None :
458458 return self ._latest_fallback_sample
459459
460- if primary_fetcher_sample .timestamp < self ._latest_fallback_sample .timestamp :
460+ if primary_fetcher_value .timestamp < self ._latest_fallback_sample .timestamp :
461461 return None
462462
463463 # Synchronize the fallback fetcher with primary one
464- while primary_fetcher_sample .timestamp > self ._latest_fallback_sample .timestamp :
464+ while primary_fetcher_value .timestamp > self ._latest_fallback_sample .timestamp :
465465 self ._latest_fallback_sample = await self ._fetch_from_fallback (
466466 fallback_fetcher
467467 )
You can’t perform that action at this time.
0 commit comments