mirror of https://github.com/coddrago/Heroku
Update `cache_time` in native query answers so they are not cached anymore
parent
c98a9f610b
commit
c6b03249e8
|
@ -92,6 +92,7 @@ class Events(InlineUnit):
|
|||
for res in result
|
||||
):
|
||||
logger.error("Got invalid type from inline handler. Refer to docs for more info") # fmt: skip
|
||||
await instance.e500()
|
||||
return
|
||||
|
||||
inline_result = []
|
||||
|
@ -179,7 +180,7 @@ class Events(InlineUnit):
|
|||
]
|
||||
|
||||
try:
|
||||
await inline_query.answer(inline_result)
|
||||
await inline_query.answer(inline_result, cache_time=0)
|
||||
except Exception:
|
||||
logger.exception(f"Exception when answering inline query with result from {cmd}") # fmt: skip
|
||||
return
|
||||
|
|
|
@ -42,13 +42,15 @@ class HikkaDLMod(loader.Module):
|
|||
|
||||
strings = {"name": "HikkaDL"}
|
||||
|
||||
_connected = False
|
||||
|
||||
async def _wss(self) -> None:
|
||||
async with websockets.connect("wss://hikka.hikariatama.ru/ws") as wss:
|
||||
await wss.send(self.get("token"))
|
||||
|
||||
while True:
|
||||
ans = json.loads(await wss.recv())
|
||||
logger.debug(ans)
|
||||
self._connected = True
|
||||
if ans["event"] == "dlmod":
|
||||
try:
|
||||
msg = (
|
||||
|
@ -100,9 +102,11 @@ class HikkaDLMod(loader.Module):
|
|||
await self._wss()
|
||||
except websockets.exceptions.ConnectionClosedError:
|
||||
logger.debug("Token became invalid, revoking...")
|
||||
self._connected = False
|
||||
await self._get_token()
|
||||
except Exception:
|
||||
logger.debug("Socket disconnected, retry in 10 sec")
|
||||
self._connected = False
|
||||
|
||||
await asyncio.sleep(10)
|
||||
|
||||
|
|
Loading…
Reference in New Issue