|
@@ -162,8 +162,8 @@ def main():
|
|
|
run_flag = table_data_cnt == 0
|
|
|
begin_ts = int(time.time())
|
|
|
while run_flag:
|
|
|
- if int(time.time()) - begin_ts >= 60*5:
|
|
|
- log_.info("等待上游数据超过50分钟了,认为失败退出:{}".format(int(time.time()) - begin_ts))
|
|
|
+ if int(time.time()) - begin_ts >= 60*50:
|
|
|
+ log_.info("等待上游数据超过50分钟了,认为失败退出:过了{}秒。".format(int(time.time()) - begin_ts))
|
|
|
exit(999)
|
|
|
table_data_cnt = check_data(project, table, date, hour, mm)
|
|
|
if table_data_cnt == 0:
|
|
@@ -197,9 +197,10 @@ if __name__ == '__main__':
|
|
|
process = Process(target=main)
|
|
|
process.start()
|
|
|
|
|
|
- process.join(timeout=3600)
|
|
|
+ timeout = 60
|
|
|
+ process.join(timeout=timeout)
|
|
|
if process.is_alive():
|
|
|
- print("脚本执行时间超过1小时,执行失败。")
|
|
|
+ print("脚本执行时间超过1小时,执行失败,经过了{}秒。".format(timeout))
|
|
|
process.terminate()
|
|
|
exit(999)
|
|
|
log_.info("完成执行:" + datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
|
|
@@ -207,7 +208,7 @@ if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
"""
|
|
|
!!!!!!!!!!!!!!
|