改成了每小时整点执行抖音播放量抓取
This commit is contained in:
parent
fe6c867579
commit
feb4d83b8d
@ -266,9 +266,10 @@ class DouyinAutoScheduler:
|
|||||||
|
|
||||||
def setup_schedule(self):
|
def setup_schedule(self):
|
||||||
"""设置定时任务"""
|
"""设置定时任务"""
|
||||||
# 每小时执行一次抖音播放量抓取
|
# 每小时的整点执行抖音播放量抓取
|
||||||
schedule.every().hour.do(self.run_douyin_scraper)
|
schedule.every().hour.at(":00").do(self.run_douyin_scraper)
|
||||||
logging.info(f"⏰ 定时器已设置:每小时执行抖音播放量抓取")
|
|
||||||
|
logging.info(f"⏰ 定时器已设置:每小时整点执行抖音播放量抓取")
|
||||||
|
|
||||||
def show_next_run(self):
|
def show_next_run(self):
|
||||||
"""显示下次执行时间"""
|
"""显示下次执行时间"""
|
||||||
@ -307,7 +308,7 @@ class DouyinAutoScheduler:
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
# 每分钟显示一次状态
|
# 每分钟显示一次状态
|
||||||
if int(time.time()) % 60 == 0:
|
if int(time.time()) % 600 == 0:
|
||||||
self.show_next_run()
|
self.show_next_run()
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user