You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
enable for all posix
This commit is contained in:
@@ -152,14 +152,14 @@ class ModuleManager:
|
|||||||
assert spec.loader
|
assert spec.loader
|
||||||
try:
|
try:
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
if sys.platform == "linux":
|
if os.name == "posix":
|
||||||
def handler(signum, frame): raise TimeoutError("Module loading timed out")
|
def handler(signum, frame): raise TimeoutError("Module loading timed out")
|
||||||
signal.signal(signal.SIGALRM, handler)
|
signal.signal(signal.SIGALRM, handler)
|
||||||
signal.alarm(5)
|
signal.alarm(5)
|
||||||
try: spec.loader.exec_module(module)
|
try: spec.loader.exec_module(module)
|
||||||
except TimeoutError: self.logger.error(f"Module {module_name} took too long to load and was skipped.")
|
except TimeoutError: self.logger.error(f"Module {module_name} took too long to load and was skipped.")
|
||||||
finally:
|
finally:
|
||||||
if sys.platform == "linux": signal.alarm(0)
|
if os.name == "posix": signal.alarm(0)
|
||||||
if (time_took := time.perf_counter() - start) > 0.15: self.logger.warning(f"{module_name} took {time_took:.1f}s to start")
|
if (time_took := time.perf_counter() - start) > 0.15: self.logger.warning(f"{module_name} took {time_took:.1f}s to start")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc(file=self.logger.output)
|
traceback.print_exc(file=self.logger.output)
|
||||||
|
|||||||
Reference in New Issue
Block a user