Spaces:
Configuration error
Configuration error
File size: 862 Bytes
f6e1dec a4fc3a5 f6e1dec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import redis
import os
import dotenv
dotenv.load_dotenv()
hotkey_daily_indexing = redis.Redis(host = os.environ.get("REDIS_HOST"), port = os.environ.get("REDIS_PORT"), password=os.environ.get("REDIS_PASSWORD"), db = 2)
hotkey_indexing = redis.Redis(host = os.environ.get("REDIS_HOST"), port = os.environ.get("REDIS_PORT"), password=os.environ.get("REDIS_PASSWORD"), db = 3)
daily_indexing = redis.Redis(host = os.environ.get("REDIS_HOST"), port = os.environ.get("REDIS_PORT"), password=os.environ.get("REDIS_PASSWORD"), db = 4)
def get_all(redis_db):
keys = redis_db.keys()
# print(keys)
result = []
for key in keys:
value = redis_db.get(key)
result.append((key, value))
return result
if __name__ == "__main__":
print(get_all(hotkey_daily_indexing))
print(get_all(hotkey_indexing))
print(get_all(daily_indexing)) |