dokku-comp

This commit is contained in:
2023-09-11 23:04:53 +03:00
parent 4be2dc3a45
commit b9a98f1e56
25 changed files with 646 additions and 460 deletions

View File

@@ -10,8 +10,9 @@ storage = Redis.from_url(REDIS_URL)
# хранение необходимой информации о пользователях
Profile = ProfileObj(storage)
# достаёт из хранилища jsonы по маске и количеству
def scan(match='usr-*', count=100):
def scan(match="usr-*", count=100):
cursor = 0
keys = []
r = storage
@@ -27,9 +28,9 @@ def scan(match='usr-*', count=100):
# Parse the JSON data from each value
items = []
for value in values:
value_str = value.decode('utf-8')
value_str = value.decode("utf-8")
i = json.loads(value_str)
items.append(i)
print(f'scan found {len(items)} items')
print(f"scan found {len(items)} items")
return keys, items
return keys, items