31 lines
639 B
Python
31 lines
639 B
Python
"""排队进程:从 NQI、FTP/SFTP 采集入库,并导出结果文件。"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from app.bootstrap import init_db
|
|
from app.config import postgres_conninfo
|
|
from app.runtime import start_background
|
|
|
|
|
|
def main() -> None:
|
|
import asyncio
|
|
import sys
|
|
|
|
if sys.platform == "win32":
|
|
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
init_db()
|
|
start_background()
|
|
if postgres_conninfo():
|
|
from app.tasks.queue import serve
|
|
|
|
serve()
|
|
return
|
|
import time
|
|
|
|
while True:
|
|
time.sleep(3600)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|