start coroutine from the thread instead of the wrapper normal func
This commit is contained in:
parent
064f2651d5
commit
4e4a5ece15
2 changed files with 3 additions and 6 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import asyncio
|
||||
from pathlib import Path
|
||||
import queue
|
||||
from threading import Thread
|
||||
|
|
@ -18,7 +19,7 @@ from ui_exporter import export_immoweb
|
|||
app = FastAPI()
|
||||
|
||||
# Start worker thread
|
||||
Thread(target=dump_listings_worker, daemon=True).start()
|
||||
Thread(target=asyncio.run, args=[dump_listings_worker()], daemon=True).start()
|
||||
|
||||
# Allow CORS (for React frontend)
|
||||
app.add_middleware(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue