mirror of
https://github.com/veops/cmdb.git
synced 2025-08-08 13:53:39 +08:00
delete settings.py
This commit is contained in:
10
lib/utils.py
10
lib/utils.py
@@ -4,17 +4,17 @@
|
||||
import redis
|
||||
|
||||
from flask import current_app
|
||||
import settings
|
||||
|
||||
|
||||
class RedisHandler(object):
|
||||
def __init__(self):
|
||||
config = current_app.config
|
||||
try:
|
||||
pool = redis.ConnectionPool(
|
||||
max_connections=settings.REDIS_MAX_CONN,
|
||||
host=settings.REDIS_HOST,
|
||||
port=settings.REDIS_PORT,
|
||||
db=settings.REDIS_DB)
|
||||
max_connections=config.get("REDIS_MAX_CONN"),
|
||||
host=config.get("CACHE_REDIS_HOST"),
|
||||
port=config.get("CACHE_REDIS_PORT"),
|
||||
db=config.get("REDIS_DB"))
|
||||
self.r = redis.Redis(connection_pool=pool)
|
||||
except Exception as e:
|
||||
print e
|
||||
|
Reference in New Issue
Block a user