mirror of
https://github.com/lemeow125/StudE-Backend.git
synced 2024-11-17 06:19:24 +08:00
15 lines
361 B
Python
15 lines
361 B
Python
|
import time
|
||
|
import os
|
||
|
import redis
|
||
|
|
||
|
REDIS_HOST = os.getenv('REDIS_HOST', 'localhost')
|
||
|
REDIS_PORT = os.getenv('REDIS_PORT', 6379)
|
||
|
if __name__ == '__main__':
|
||
|
while True:
|
||
|
try:
|
||
|
redis.Redis(host=REDIS_HOST, port=REDIS_PORT)
|
||
|
print('Redis is up!')
|
||
|
break
|
||
|
except redis.ConnectionError:
|
||
|
time.sleep(0.1)
|