feat: 简化配置,支持 daemon 运行

This commit is contained in:
amtoaer
2023-11-22 21:53:37 +08:00
parent 6f8b4afa1c
commit 5cc429e353
5 changed files with 47 additions and 41 deletions

17
entry.py Normal file
View File

@@ -0,0 +1,17 @@
from processor import process
import sys
import asyncio
from settings import settings
async def entry() -> None:
if any("once" in _ for _ in sys.argv):
# 单次运行
await process()
while True:
await process()
await asyncio.sleep(settings.interval)
def start() -> None:
asyncio.run(entry())