修改: PriceSystem/CalcCmdSender.py
This commit is contained in:
@@ -10,6 +10,7 @@ import pytz
|
||||
from datetime import date
|
||||
|
||||
|
||||
'''
|
||||
def get_weekend(tt):
|
||||
|
||||
from dateutil.parser import parse
|
||||
@@ -18,7 +19,7 @@ def get_weekend(tt):
|
||||
return pacific.localize(bb)
|
||||
|
||||
weekend = get_weekend('20180527')
|
||||
|
||||
'''
|
||||
|
||||
class CJsonEncoder(json.JSONEncoder):
|
||||
def default(self, obj):
|
||||
@@ -31,9 +32,9 @@ class CJsonEncoder(json.JSONEncoder):
|
||||
|
||||
|
||||
QUEUE = "calc_cmd"
|
||||
#redisPool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=config.get_redis_db())
|
||||
redisPool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=config.get_redis_db())
|
||||
|
||||
|
||||
redisPool = redis.ConnectionPool(host=config.get_redis_host(), port=6379, db=3)
|
||||
|
||||
|
||||
client = redis.Redis(connection_pool=redisPool)
|
||||
@@ -41,7 +42,7 @@ logger = fangjia.get_logger("CalcCmdSender")
|
||||
|
||||
|
||||
def get_district(city):
|
||||
#weekend = fangjia.get_weekend()
|
||||
weekend = fangjia.get_weekend()
|
||||
seaweeds = []
|
||||
keys = {"city": 1, "region": 1, "name": 1, "_id": 0}
|
||||
for dis in fangjia.get_collection("fangjia", "seaweed").find({"cat": "district", "status": 0, "city": city}, keys):
|
||||
|
||||
Reference in New Issue
Block a user