From cf29f3bf71c9111e2ebb62721e3abfc474146ae8 Mon Sep 17 00:00:00 2001 From: pengtao Date: Tue, 22 Oct 2019 14:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0daily=20report=E7=94=9F?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daily_report/dreport.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/daily_report/dreport.py b/daily_report/dreport.py index 195f461..cedd403 100644 --- a/daily_report/dreport.py +++ b/daily_report/dreport.py @@ -248,14 +248,17 @@ class Report: and "jump_appid"='{jump_appid}' and "jump_result"=1 """ - try: - jump_num, jump_pre = self.tga.get_data(jump_sql)[0] - return (jump_appid, FROMAPPID_CN.get(jump_appid, None), jump_num, jump_pre) - except Exception: - log.error(f"get data from output by {self.gameid} {jump_appid} failed", exc_info=True) + data = self.tga.get_data(jump_sql) + if data: + try: + jump_num, jump_pre = data[0] + return (jump_appid, FROMAPPID_CN.get(jump_appid, None), jump_num, jump_pre) + except Exception: + log.error(f"get data from output by {self.gameid} {jump_appid} failed", exc_info=True) + return None + else: return None - def run(self): data = dict() data['day'] = self.day @@ -267,11 +270,11 @@ class Report: data['output'] = [] fromappids = FROMAPPID_CN.keys() for fromappid in fromappids: - pdb.set_trace() data['input'].append(self.get_input_fromappid(fromappid)) data['output'].append(self.get_output_fromappid(fromappid)) + print(data) + - print(data)