mirror of
https://github.com/amtoaer/bili-sync.git
synced 2026-05-11 10:00:18 +08:00
feat: 简化配置,支持 daemon 运行
This commit is contained in:
17
entry.py
Normal file
17
entry.py
Normal 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())
|
||||
Reference in New Issue
Block a user