mirror of
https://github.com/Faraphel/Atlas-Install.git
synced 2025-07-07 05:08:23 +02:00
threaded decorator now return the thread
This commit is contained in:
parent
186aa55f4a
commit
39bd521511
1 changed files with 3 additions and 1 deletions
|
@ -27,7 +27,9 @@ def threaded(func: Callable) -> Callable:
|
||||||
|
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
# run the function in a Daemon, so it will stop when the main thread stops
|
# run the function in a Daemon, so it will stop when the main thread stops
|
||||||
Thread(target=func, args=args, kwargs=kwargs, daemon=True).start()
|
thread = Thread(target=func, args=args, kwargs=kwargs, daemon=True)
|
||||||
|
thread.start()
|
||||||
|
return thread
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue