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