Skip to content

Commit 17d983a

Browse files
committed
Remove unreachable code
After some refactoring, result can't be `None` anymore, so we don't need to consider that case. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent c2702e2 commit 17d983a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/frequenz/sdk/timeseries/battery_pool/_methods.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,8 @@ async def _send_on_update(self, min_update_interval: timedelta) -> None:
252252
latest_calculation_result = result
253253
await sender.send(result)
254254

255-
if result is None:
256-
sleep_for = min_update_interval.total_seconds()
257-
else:
258-
# Sleep for the rest of the time.
259-
# Then we won't send update more frequently then min_update_interval
260-
time_diff = datetime.now(tz=timezone.utc) - result.timestamp
261-
sleep_for = (min_update_interval - time_diff).total_seconds()
255+
# Sleep for the rest of the time.
256+
# Then we won't send update more frequently then min_update_interval
257+
time_diff = datetime.now(tz=timezone.utc) - result.timestamp
258+
sleep_for = (min_update_interval - time_diff).total_seconds()
262259
await asyncio.sleep(sleep_for)

0 commit comments

Comments
 (0)