Add omitted file
This commit is contained in:
parent
ae30f54f2f
commit
ebaaedecd9
18
apps/cic-eth/cic_eth/check/redis.py
Normal file
18
apps/cic-eth/cic_eth/check/redis.py
Normal file
@ -0,0 +1,18 @@
|
||||
# external imports
|
||||
import redis
|
||||
import os
|
||||
|
||||
|
||||
def health(*args, **kwargs):
|
||||
r = redis.Redis(
|
||||
host=kwargs['config'].get('REDIS_HOST'),
|
||||
port=kwargs['config'].get('REDIS_PORT'),
|
||||
db=kwargs['config'].get('REDIS_DB'),
|
||||
)
|
||||
try:
|
||||
r.set(kwargs['unit'], os.getpid())
|
||||
except redis.connection.ConnectionError:
|
||||
return False
|
||||
except redis.connection.ResponseError:
|
||||
return False
|
||||
return True
|
Loading…
Reference in New Issue
Block a user