From f34821c341ebc7c84216a14b3ac0e3c1e067cd09 Mon Sep 17 00:00:00 2001 From: "wangwenyan@fangjia.com" Date: Wed, 11 Apr 2018 16:40:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9D=87=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/CalcCmdSender.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PriceSystem/CalcCmdSender.py b/PriceSystem/CalcCmdSender.py index 671bfa6..a7f23d9 100644 --- a/PriceSystem/CalcCmdSender.py +++ b/PriceSystem/CalcCmdSender.py @@ -90,7 +90,7 @@ def all_calc_cmd_finish(start_time): calc_command = fangjia.get_collection("fangjia_log", "calc_command", config.get_log_mongodb_host(), config.get_log_mongodb_port()) query = { - "status": 4, + "status": {"$in": [0, 1, 103]}, "c_date": { "$gt": start_time } From b144cedbb4b6d4f7ffd1f48846dfb0c354d2b469 Mon Sep 17 00:00:00 2001 From: "wangwenyan@fangjia.com" Date: Thu, 12 Apr 2018 09:59:22 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/fangjia/__init__.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/PriceSystem/fangjia/__init__.py b/PriceSystem/fangjia/__init__.py index 230b49f..29c910e 100644 --- a/PriceSystem/fangjia/__init__.py +++ b/PriceSystem/fangjia/__init__.py @@ -25,7 +25,7 @@ def get_logger(name): file_handler = logging.FileHandler("/home/goojia/logs/" + name + ".log") file_handler.setFormatter(formatter) logger.addHandler(file_handler) - logger.setLevel("ERROR") + logger.setLevel("INFO") return logger @@ -39,14 +39,9 @@ def get_performance_logger(name): file_handler = logging.FileHandler("/home/goojia/logs/" + name + ".performance.log") file_handler.setFormatter(formatter) logger.addHandler(file_handler) - logger.setLevel("ERROR") + logger.setLevel("INFO") return logger - now = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) - for day in range(1, 9): - if calendar.weekday(now.year, now.month, now.day) == 6: - break - now = now + datetime.timedelta(days=1) performance_logger = get_performance_logger("performance") From b8ed0aa167b2f6d5eb97b140e5cbb7187711d40a Mon Sep 17 00:00:00 2001 From: "wangwenyan@fangjia.com" Date: Thu, 12 Apr 2018 10:31:26 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9D=87=E4=BB=B7?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=A8=8B=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/CalcCmdSender.py | 2 +- PriceSystem/fangjia/__init__.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PriceSystem/CalcCmdSender.py b/PriceSystem/CalcCmdSender.py index a7f23d9..9bed1af 100644 --- a/PriceSystem/CalcCmdSender.py +++ b/PriceSystem/CalcCmdSender.py @@ -109,7 +109,7 @@ if __name__ == "__main__": start_time = datetime.datetime.utcnow() send_district_calc_cmd() while not district_calc_cmd_finish(): - time.sleep(5) + time.sleep(10) logger.info("等待小区均价计算完成") send_city_calc_cmd() logger.info("城市均价计算完成") diff --git a/PriceSystem/fangjia/__init__.py b/PriceSystem/fangjia/__init__.py index 29c910e..96eaf10 100644 --- a/PriceSystem/fangjia/__init__.py +++ b/PriceSystem/fangjia/__init__.py @@ -57,10 +57,8 @@ def timer(func): arg_list = list() for arg in args: arg_list.append(str(arg)) - if elapsed > config.get_timeout() * 10: + if elapsed > config.get_timeout(): performance_logger.info("函数名:%-20s\t耗时:%7.4f\t\t参数:(%s)" % (func.__name__, end - begin, arg_list)) - else: - performance_logger.error("函数名:%-20s\t耗时:%7.4f\t\t参数:(%s)" % (func.__name__, end - begin, arg_list)) return rs return _timer From e3a1832f8bd0e1fa8d774d73005729d3c862b083 Mon Sep 17 00:00:00 2001 From: "wangwenyan@fangjia.com" Date: Thu, 12 Apr 2018 10:53:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=A7=BB=E9=99=A4matplotlib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PriceSystem/fix/price_fix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PriceSystem/fix/price_fix.py b/PriceSystem/fix/price_fix.py index 9102098..b9b9c4b 100644 --- a/PriceSystem/fix/price_fix.py +++ b/PriceSystem/fix/price_fix.py @@ -14,7 +14,7 @@ from pandas import DataFrame,Series from numpy import row_stack,column_stack from dateutil.parser import parse import pandas -import matplotlib.pyplot as plt +# import matplotlib.pyplot as plt import numpy as np import numpy import collections