osnova-api-alert/redis_db/crud.py

17 lines
419 B
Python

import logging as log
from r_helper import RedisClient
async def set_value(key, value):
async with RedisClient() as redis_client:
await redis_client.set_value(key, value)
log.info("Set %s = %s", key, value)
async def get_value(key):
async with RedisClient() as redis_client:
value = await redis_client.get_value(key)
log.info("Get %s = %s", key, value)
return value