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