dp.redis = StrictRedis(host='localhost', port='6379', db=0)
print(dp.redis.ping())
# Wait for Redis to be ready
async def aredis_wait():
ping = False
while ping == False:
try:
ping = await dp.redis.ping()
except:
pass
logger.info(str('Redis Alive:' + str(ping)))
await asyncio.sleep(1)
asyncio.get_event_loop().run_until_complete(aredis_wait())
вот что выводится в консоль:
None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used.
<coroutine object ConnectionCommandMixin.ping at 0x000001F33ADB5AF0>
F:\progesNOprogress\pythonProject\bot\main.py:138: RuntimeWarning: coroutine 'ConnectionCommandMixin.ping' was never awaited
print(dp.redis.ping())
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
F:\progesNOprogress\pythonProject\bot\main.py:151: DeprecationWarning: There is no current event loop
asyncio.get_event_loop().run_until_complete(aredis_wait())
2023-02-14 17:12:27.315 | INFO | __main__:aredis_wait:148 - Redis Alive:False
2023-02-14 17:12:28.323 | INFO | __main__:aredis_wait:148 - Redis Alive:False
2023-02-14 17:12:29.338 | INFO | __main__:aredis_wait:148 - Redis Alive:False