base context for wrappers updated

This commit is contained in:
2025-01-17 20:00:53 +03:00
parent 61229cb761
commit 628f6bd483
21 changed files with 404 additions and 300 deletions

View File

@@ -77,12 +77,7 @@ class RedisActions:
time=expiry_time,
value=redis_row.value,
)
redis_row.expires_at = (
arrow.now()
.shift(seconds=expiry_time)
.format(MainConfig.DATETIME_FORMAT)
)
redis_row.expires_at = str(arrow.now().shift(seconds=expiry_time).format(MainConfig.DATETIME_FORMAT))
else:
redis_cli.set(name=redis_row.redis_key, value=redis_row.value)
@@ -115,7 +110,6 @@ class RedisActions:
list_of_rows = []
regex = RedisRow.regex(list_keys=list_keys)
json_get = redis_cli.scan_iter(match=regex)
for row in list(json_get):
redis_row = RedisRow()
redis_row.set_key(key=row)
@@ -123,11 +117,16 @@ class RedisActions:
redis_value = redis_cli.get(redis_row.redis_key)
redis_row.feed(redis_value)
list_of_rows.append(redis_row)
if list_of_rows:
return RedisResponse(
status=True,
message="Value is get successfully.",
data=list_of_rows,
)
return RedisResponse(
status=True,
message="Value is get successfully.",
data=list_of_rows,
status=False,
message="Value is not get successfully.",
data=list_of_rows
)
except Exception as e:
return RedisResponse(
@@ -135,3 +134,4 @@ class RedisActions:
message="Value is not get successfully.",
error=str(e),
)