def start(self): """ 处理单个任务 根据日期循环查询, 展示处理时间 :param job: :return: """ while True and self.is_alive: app_available_check() QueryLog.print_job_start(self.job_name) for station in self.stations: self.refresh_station(station) for date in self.left_dates: self.left_date = date response = self.query_by_date(date) self.handle_response(response) QueryLog.add_query_time_log( time=response.elapsed.total_seconds(), is_cdn=self.is_cdn) if not self.is_alive: return self.safe_stay() if is_main_thread(): QueryLog.flush(sep='\t\t', publish=False) if not Config().QUERY_JOB_THREAD_ENABLED: QueryLog.add_quick_log('').flush(publish=False) break else: QueryLog.add_log('\n').flush(sep='\t\t', publish=False) if Const.IS_TEST: return
def start(self): """ 处理单个任务 根据日期循环查询 展示处理时间 :param job: :return: """ QueryLog.print_job_start() for date in self.left_dates: self.left_date = date response = self.query_by_date(date) self.handle_response(response) self.safe_stay() if is_main_thread(): QueryLog.flush(sep='\t\t') if is_main_thread(): QueryLog.add_quick_log('').flush() else: QueryLog.add_log('\n').flush(sep='\t\t')