mirror of
https://github.com/bellingcat/auto-archiver.git
synced 2026-06-12 21:28:29 +03:00
enables api_db cache queries if configured with new option (#113)
This commit is contained in:
committed by
GitHub
parent
3e56ef137d
commit
6f36e92e02
@@ -105,7 +105,8 @@ class Metadata:
|
||||
|
||||
def get_timestamp(self, utc=True, iso=True) -> datetime.datetime:
|
||||
ts = self.get("timestamp")
|
||||
if not ts: return ts
|
||||
if not ts: return
|
||||
if type(ts) == float: ts = datetime.datetime.fromtimestamp(ts)
|
||||
if utc: ts = ts.replace(tzinfo=datetime.timezone.utc)
|
||||
if iso: return ts.isoformat()
|
||||
return ts
|
||||
|
||||
@@ -77,7 +77,7 @@ class ArchivingOrchestrator:
|
||||
if cached_result:
|
||||
logger.debug("Found previously archived entry")
|
||||
for d in self.databases:
|
||||
d.done(cached_result)
|
||||
d.done(cached_result, cached=True)
|
||||
return cached_result
|
||||
|
||||
# 3 - call archivers until one succeeds
|
||||
|
||||
Reference in New Issue
Block a user