Skip to content

Commit

Permalink
Dont wait for child process to exit
Browse files Browse the repository at this point in the history
  • Loading branch information
MasloMaslane committed Oct 28, 2023
1 parent 0a3da12 commit 3e850dd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sinol_make/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shutil
import hashlib
import subprocess
import threading
import multiprocessing
import resource
from typing import Union

Expand Down Expand Up @@ -140,8 +140,9 @@ def check_for_updates(current_version) -> Union[str, None]:
os.mkdir(data_dir)

# We check for new version asynchronously, so that it doesn't slow down the program.
thread = threading.Thread(target=check_version)
thread.start()
# If the main process exits, the check_version process will also exit.
process = multiprocessing.Process(target=check_version, daemon=True)
process.start()
version_file = data_dir.joinpath("version")

try:
Expand Down

0 comments on commit 3e850dd

Please sign in to comment.