From 63cd5084aacb9f97bc8b89401042d90ff16a77fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=B9=B2?= Date: Mon, 28 May 2018 15:04:22 +0800 Subject: [PATCH] =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20Pr?= =?UTF-8?q?iceSystem/CalcCmdSender.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/CalcCmdSender.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PriceSystem/CalcCmdSender.py b/PriceSystem/CalcCmdSender.py index 2c69f99..f6d8456 100644 --- a/PriceSystem/CalcCmdSender.py +++ b/PriceSystem/CalcCmdSender.py @@ -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):