Skip to content

Commit

Permalink
create_task instead of run
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Nov 24, 2024
1 parent 248b77d commit b1e184a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cashu/mint/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def __init__(self):
if settings.mint_redis_cache_url is None:
raise CashuError("Redis cache url not provided")
self.redis = from_url(settings.mint_redis_cache_url)
asyncio.run(self.test_connection())
asyncio.create_task(self.test_connection())

async def test_connection(self):
# PING
try:
await self.redis.ping()
logger.success("Redis caching server running")
logger.success("Connected to Redis caching server.")
except ConnectionError as e:
logger.error("Redis connection error")
logger.error("Redis connection error.")
raise e

def cache(self, expire):
Expand Down

0 comments on commit b1e184a

Please sign in to comment.