From c46b06b5365c49183801aeef470deb239b8df950 Mon Sep 17 00:00:00 2001 From: Nixevol Date: Fri, 30 Oct 2026 10:35:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8E=92=E9=98=9F=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=E5=9C=A8=E5=AE=89=E8=A3=85=E5=AE=8C=E6=88=90=E5=90=8E=E5=86=8D?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/worker/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/worker/main.py b/backend/worker/main.py index 0eaa0ff..42b24bd 100644 --- a/backend/worker/main.py +++ b/backend/worker/main.py @@ -17,15 +17,14 @@ def main() -> None: 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) + while not postgres_conninfo(): + time.sleep(2) + init_db() + from app.tasks.queue import serve + + serve() if __name__ == "__main__":