mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
Add a compatibility check test at startup
This commit is contained in:
parent
3c363ea084
commit
e24389d5b4
1 changed files with 20 additions and 0 deletions
|
@ -53,3 +53,23 @@ def redis_incrby(k,v):
|
|||
return redisdb.incrby(k,v)
|
||||
|
||||
|
||||
def CompatibilityCheck():
|
||||
try:
|
||||
r = redis.Redis()
|
||||
if not r.pipeline: raise RuntimeError('pipeline call not found')
|
||||
p = r.pipeline()
|
||||
if not p.get: raise RuntimeError('get call not found')
|
||||
if not p.set: raise RuntimeError('set call not found')
|
||||
if not p.hexists: raise RuntimeError('hexists call not found')
|
||||
if not p.hget: raise RuntimeError('hget call not found')
|
||||
if not p.hgetall: raise RuntimeError('hgetall call not found')
|
||||
if not p.hset: raise RuntimeError('hset call not found')
|
||||
if not p.hincrby: raise RuntimeError('hincrby call not found')
|
||||
if not p.incrby: raise RuntimeError('incrby call not found')
|
||||
if not p.execute: raise RuntimeError('execute call not found')
|
||||
except Exception,e:
|
||||
log_error('Error checking redis compatibility: %s' % str(e))
|
||||
exit(1)
|
||||
|
||||
CompatibilityCheck()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue