mirror of
https://github.com/0-8-4/miui-auto-tasks.git
synced 2024-11-16 04:35:51 +00:00
chore: 添加自动每日运行时间提示 (#201)
* 🔧 自动更新requirements
* chore: 添加自动每日运行时间提示
* chore: 将时间类型从str改成int
* Add files via upload
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
23360a63b2
commit
fe7d6cf800
@ -42,11 +42,14 @@ async def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if _conf.preference.hour and _conf.preference.minute:
|
||||
HOUR = _conf.preference.hour
|
||||
MINUTE = _conf.preference.minute
|
||||
if HOUR and MINUTE:
|
||||
log.info(f"脚本将在每日{HOUR}:{MINUTE}自动运行")
|
||||
# 创建一个新的事件循环
|
||||
loop = asyncio.get_event_loop()
|
||||
scheduler = AsyncIOScheduler()
|
||||
scheduler.add_job(main, 'cron', hour=_conf.preference.hour, minute=_conf.preference.minute, id='miuitask')
|
||||
scheduler.add_job(main, 'cron', hour=HOUR, minute=MINUTE, id='miuitask')
|
||||
scheduler.start()
|
||||
try:
|
||||
loop.run_forever()
|
||||
|
@ -4,7 +4,6 @@ httpx==0.25.1
|
||||
loguru==0.7.2
|
||||
onepush==1.3.0
|
||||
orjson==3.9.10
|
||||
pydantic==2.5.1
|
||||
pydantic==2.5.2
|
||||
PyYAML==6.0.1
|
||||
tenacity==8.2.3
|
||||
tzdata==2023.3
|
||||
|
@ -97,9 +97,9 @@ class Preference(BaseModel):
|
||||
"""极验自定义params参数"""
|
||||
geetest_data: Dict = {}
|
||||
"""极验自定义data参数"""
|
||||
hour: Optional[str] = None
|
||||
hour: Optional[int] = None
|
||||
"""自动执行的时间"""
|
||||
minute: Optional[str] = None
|
||||
minute: Optional[int] = None
|
||||
"""自动执行的时间"""
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user