Skip to content

Commit

Permalink
fixed expiry not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe committed Oct 22, 2019
1 parent 980df50 commit 13637af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

__version = '0.5.3'
__version = '0.5.4'

INSTALL_REQUIRE = ['requests>=2.20.0']

Expand Down
4 changes: 2 additions & 2 deletions src/webscrapetools/keyvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def invalidate_expired_entries(as_of_date: datetime=None) -> None:
:param as_of_date: fake current date (for dev only)
:return:
"""
if not _get_expiry():
expiry_periods, expiry_unit = _get_expiry()
if not expiry_periods:
return

index_name = _fileindex_name()
Expand All @@ -90,7 +91,6 @@ def invalidate_expired_entries(as_of_date: datetime=None) -> None:
if as_of_date is None:
as_of_date = datetime.today()

expiry_periods, expiry_unit = _get_expiry()
if expiry_unit == 'day':
expiry_date = as_of_date - timedelta(days=expiry_periods)

Expand Down

0 comments on commit 13637af

Please sign in to comment.