From f42966de9733a0cb52eae34ff3fd057398f9a19d Mon Sep 17 00:00:00 2001
From: Tim Kreuzer <t.kreuzer@fz-juelich.de>
Date: Fri, 1 Dec 2023 16:46:30 +0100
Subject: [PATCH] load flavor specific timeout

---
 lmod/files/start_jupyter.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lmod/files/start_jupyter.sh b/lmod/files/start_jupyter.sh
index 7381f00..eae0160 100644
--- a/lmod/files/start_jupyter.sh
+++ b/lmod/files/start_jupyter.sh
@@ -16,6 +16,13 @@ set_env() {
   export PYTHONNOUSERSITE=1
   export MODULEPATH=/p/software/jsccloud/productionstages
   export OTHERSTAGES=/p/software/jsccloud/productionstages
+  JUPYTER_FLAVOR_VARS=/tmp/custom/load_flavor_variables.sh
+  if [ -f $JUPYTER_FLAVOR_VARS ]; then
+    source $JUPYTER_FLAVOR_VARS
+  else
+    echo "File $JUPYTER_FLAVOR_VARS does not exist. Use 12h as default timeout."
+    export JUPYTERHUB_TIMEOUT=12h
+  fi
   echo "$(date) - Set environment variables done" 
 }
 
@@ -119,7 +126,7 @@ cleanup () {
 
 start () {
   echo "$(date) - Start jupyterhub-singleuser ..."
-  timeout 30d jupyterhub-singleuser 2>${JUPYTER_LOG_DIR}/stderr 1>${JUPYTER_LOG_DIR}/stdout
+  timeout $JUPYTERHUB_TIMEOUT jupyterhub-singleuser 2>${JUPYTER_LOG_DIR}/stderr 1>${JUPYTER_LOG_DIR}/stdout
   echo "$(date) - Start jupyterhub-singleuser done" 
 }
 
-- 
GitLab