Skip to content

Commit 08430e2

Browse files
authored
Merge pull request #133 from Matthew-Grayson/develop
Fixes issue 132 (Public Suffix List (PSL) Updates Too Often)
2 parents 16ce619 + eba45b9 commit 08430e2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/trustymail/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""This file defines the version of this module."""
2-
__version__ = "0.8.1"
2+
__version__ = "0.8.2"

src/trustymail/domain.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Standard Python Libraries
44
from collections import OrderedDict
55
from datetime import datetime, timedelta
6-
from os import path, stat
6+
from os import path, stat, utime
77
from typing import Dict
88

99
# Third-Party Libraries
@@ -24,12 +24,14 @@ def get_psl():
2424
if not PublicSuffixListReadOnly:
2525
if not path.exists(PublicSuffixListFilename):
2626
updatePSL(PublicSuffixListFilename)
27+
utime(PublicSuffixListFilename, None) # Set mtime to now
2728
else:
2829
psl_age = datetime.now() - datetime.fromtimestamp(
2930
stat(PublicSuffixListFilename).st_mtime
3031
)
3132
if psl_age > timedelta(hours=24):
3233
updatePSL(PublicSuffixListFilename)
34+
utime(PublicSuffixListFilename, None) # Set mtime to now
3335

3436
with open(PublicSuffixListFilename, encoding="utf-8") as psl_file:
3537
psl = PublicSuffixList(psl_file)

0 commit comments

Comments
 (0)