logs-fix
All checks were successful
deploy / deploy (push) Successful in 1m10s

This commit is contained in:
Untone 2023-12-25 01:53:14 +03:00
parent ce02ce0130
commit e7b9d419c4

View File

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