headers = {}
if timestamp:
headers = {}
if timestamp:
- headers["If-Modified-Since"] = timestamp.strftime(
- "%a, %d %b %Y %H:%M:%S GMT",
+ headers["If-Modified-Since"] = time.strftime(
+ "%a, %d %b %Y %H:%M:%S GMT", time.gmtime(timestamp),
)
t = tempfile.NamedTemporaryFile(dir=tmpdir, delete=False)
)
t = tempfile.NamedTemporaryFile(dir=tmpdir, delete=False)
db = Database(f.name)
# Database is not recent
db = Database(f.name)
# Database is not recent
- if timestamp and db.created_at < timestamp.timestamp():
+ if timestamp and db.created_at < timestamp:
return False
log.info("Downloaded new database from %s" % (time.strftime(
return False
log.info("Downloaded new database from %s" % (time.strftime(
# Try downloading a new database
try:
# Try downloading a new database
try:
- t = d.download(public_key=ns.public_key, timestamp=timestamp, tmpdir=tmpdir)
+ t = d.download(public_key=ns.public_key, timestamp=t, tmpdir=tmpdir)
# If no file could be downloaded, log a message
except FileNotFoundError as e:
# If no file could be downloaded, log a message
except FileNotFoundError as e: