Skip to content

Commit

Permalink
move the possible block function to its own thread
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Jan 4, 2025
1 parent de5cb2e commit 5e9bbbc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apiserver/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def xui_login() -> None:

def get_xui_info(path_suffix: str) -> dict:
while (info := xui_session.post(XUI_URL + path_suffix)).status_code != 200:
xui_login()
threading.Thread(target=xui_login, daemon=True).start()

return info.json()

Expand Down Expand Up @@ -255,9 +255,7 @@ def main() -> None:
load_all_cache()
signal.signal(signal.SIGTERM, handle_sigterm)

api_thread = threading.Thread(target=start_api_server)
api_thread.daemon = True
api_thread.start()
threading.Thread(target=start_api_server, daemon=True).start()

schedule.every().hour.at(f":{str(UPDATE_INTERVAL * 0).zfill(2)}").do(
update_status, symbols=STOCKS
Expand Down

0 comments on commit 5e9bbbc

Please sign in to comment.