This commit is contained in:
parent
ce02ce0130
commit
e7b9d419c4
|
@ -16,7 +16,8 @@ def _request_endpoint(query_name, body) -> dict:
|
|||
try:
|
||||
r = response.json()
|
||||
result = r.get("data", {}).get(query_name, {})
|
||||
print(f"[services.core] entries amount in result: {len(result)} ")
|
||||
if result:
|
||||
print(f"[services.core] entries amount in result: {len(result)} ")
|
||||
return result
|
||||
except ValueError as e:
|
||||
print(f"[services.core] Error decoding JSON response: {e}")
|
||||
|
@ -87,7 +88,6 @@ class CacheStorage:
|
|||
self.authors_by_user[a.user] = a
|
||||
self.authors_by_id[a.id] = a
|
||||
|
||||
|
||||
@staticmethod
|
||||
async def worker():
|
||||
"""async task worker"""
|
||||
|
@ -107,10 +107,7 @@ class CacheStorage:
|
|||
if failed == 0:
|
||||
when = datetime.now(timezone.utc) + timedelta(seconds=self.period)
|
||||
t = format(when.astimezone().isoformat())
|
||||
print(
|
||||
"[services.core] ⎩ next update: %s"
|
||||
% (t.split("T")[0] + " " + t.split("T")[1].split(".")[0])
|
||||
)
|
||||
print("[services.core] ⎩ next update: %s" % (t.split("T")[0] + " " + t.split("T")[1].split(".")[0]))
|
||||
await asyncio.sleep(self.period)
|
||||
else:
|
||||
await asyncio.sleep(10)
|
||||
|
|
Loading…
Reference in New Issue
Block a user