Skip to content

Commit a06cd6c

Browse files
committed
Fixes a bug where the local_ttl was not being calculated correctly leading to no new downloads - #11
1 parent 7b49271 commit a06cd6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/hibp_downloader/commands/hibp_download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async def pwnedpasswords_get_and_store_async(
265265
if metadata_existing.data_source:
266266
if metadata_existing.server_timestamp:
267267
local_ttl = (
268-
local_cache_ttl - (datetime.now().astimezone() - metadata_existing.server_timestamp).seconds # type: ignore[operator]
268+
local_cache_ttl - (datetime.now().astimezone() - metadata_existing.server_timestamp).total_seconds() # type: ignore[operator]
269269
)
270270
if local_ttl > 0:
271271
logger_.debug(f"Skipping {prefix}; local-cache has {local_ttl} time-to-live")

0 commit comments

Comments
 (0)