mirror of
https://github.com/wownero/tippero.git
synced 2026-11-14 04:53:53 +01:00
Add a compatibility check test at startup
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user