mirror of
https://github.com/veops/cmdb.git
synced 2025-08-08 04:37:31 +08:00
delete settings.py
This commit is contained in:
3
lib/spec_query_sql.py
Normal file
3
lib/spec_query_sql.py
Normal file
@@ -0,0 +1,3 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
|
||||
__author__ = 'pycook'
|
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