|
@@ -8,8 +8,8 @@ from Ansjer.config import SERVER_HOST
|
|
|
|
|
|
class RedisObject:
|
|
class RedisObject:
|
|
|
|
|
|
- def __init__(self, db=0):
|
|
|
|
- self.POOL = redis.ConnectionPool(host=SERVER_HOST, port=6379, db=db)
|
|
|
|
|
|
+ def __init__(self, db=0, host=SERVER_HOST):
|
|
|
|
+ self.POOL = redis.ConnectionPool(host=host, port=6379, db=db)
|
|
self.CONN = redis.Redis(connection_pool=self.POOL)
|
|
self.CONN = redis.Redis(connection_pool=self.POOL)
|
|
|
|
|
|
def set_data(self, key, val, expire=0):
|
|
def set_data(self, key, val, expire=0):
|