From 3f7fc99b6b343fbc8df319d8130ba8247aea96d8 Mon Sep 17 00:00:00 2001 From: Jonas L Date: Sun, 7 Jan 2024 14:30:20 +0100 Subject: [PATCH] feat: run python in optimized mode (#2874) Set PYTHONOPTIMIZE=2 to enable https://docs.python.org/3/using/cmdline.html#cmdoption-OO --- analyzer/install/systemd/libretime-analyzer.service | 1 + api/install/systemd/libretime-api.service | 1 + playout/install/systemd/libretime-liquidsoap.service | 1 + playout/install/systemd/libretime-playout.service | 1 + worker/install/systemd/libretime-worker.service | 1 + 5 files changed, 5 insertions(+) diff --git a/analyzer/install/systemd/libretime-analyzer.service b/analyzer/install/systemd/libretime-analyzer.service index 28d92ba56..e321ed8e6 100644 --- a/analyzer/install/systemd/libretime-analyzer.service +++ b/analyzer/install/systemd/libretime-analyzer.service @@ -17,6 +17,7 @@ ProtectKernelTunables=true ProtectProc=invisible ProtectSystem=full +Environment=PYTHONOPTIMIZE=2 Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@ Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/analyzer.log WorkingDirectory=@@WORKING_DIR@@/analyzer diff --git a/api/install/systemd/libretime-api.service b/api/install/systemd/libretime-api.service index 7fa5703ef..b3fdca4e5 100644 --- a/api/install/systemd/libretime-api.service +++ b/api/install/systemd/libretime-api.service @@ -18,6 +18,7 @@ ProtectKernelTunables=true ProtectProc=invisible ProtectSystem=full +Environment=PYTHONOPTIMIZE=2 Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@ Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/api.log diff --git a/playout/install/systemd/libretime-liquidsoap.service b/playout/install/systemd/libretime-liquidsoap.service index f92b35af3..72f26d2c6 100644 --- a/playout/install/systemd/libretime-liquidsoap.service +++ b/playout/install/systemd/libretime-liquidsoap.service @@ -17,6 +17,7 @@ ProtectKernelTunables=true ProtectProc=invisible ProtectSystem=full +Environment=PYTHONOPTIMIZE=2 Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@ Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/liquidsoap.log WorkingDirectory=@@WORKING_DIR@@/playout diff --git a/playout/install/systemd/libretime-playout.service b/playout/install/systemd/libretime-playout.service index 182424056..48463fd15 100644 --- a/playout/install/systemd/libretime-playout.service +++ b/playout/install/systemd/libretime-playout.service @@ -19,6 +19,7 @@ ProtectKernelTunables=true ProtectProc=invisible ProtectSystem=full +Environment=PYTHONOPTIMIZE=2 Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@ Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/playout.log WorkingDirectory=@@WORKING_DIR@@/playout diff --git a/worker/install/systemd/libretime-worker.service b/worker/install/systemd/libretime-worker.service index eb1829e01..6a6d8c7da 100644 --- a/worker/install/systemd/libretime-worker.service +++ b/worker/install/systemd/libretime-worker.service @@ -17,6 +17,7 @@ ProtectKernelTunables=true ProtectProc=invisible ProtectSystem=full +Environment=PYTHONOPTIMIZE=2 Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@ Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/worker.log WorkingDirectory=@@WORKING_DIR@@/worker