swingmusic/app/utils/threading.py
mungai-njoroge 4f757e989f redesign progressbars
+ hide some progressbars
+ rewrite telemetry into a class
+ remove obsolete start info logs
+ update contributing.md to include contributing.md
+ send posthog event in a bg thread
+ related side effects
2023-09-27 17:18:52 +03:00

13 lines
242 B
Python

import threading
def background(func):
"""
Runs the decorated function in a background thread.
"""
def background_func(*a, **kw):
threading.Thread(target=func, args=a, kwargs=kw).start()
return background_func