Made polling services async

This commit is contained in:
2025-08-29 22:36:35 +02:00
parent d7a118931b
commit d8dd7c2c5e
3 changed files with 43 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
# import requests as r
from flask import jsonify, Flask
from poll_services import update_services
from poll_services import start_async_loop
from mem import services
import threading
@@ -16,7 +16,9 @@ def status():
# Only run if directly running file
if __name__ == "__main__":
threading.Thread(target=update_services, daemon=True).start()
t = threading.Thread(target=start_async_loop, daemon=True)
t.start()
# Run flask app
app.run(debug=True, use_reloader=False)