diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index e3cd231..70167bf 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -9,7 +9,7 @@ services: restart: always ports: - "8000:8000" - command: gunicorn -w 1 -b 0.0.0.0:8000 wsgi:server --timeout 500 --worker-class=gevent + command: gunicorn -w 1 -b 0.0.0.0:8000 wsgi:server --timeout 200 --worker-class=gevent #command: bash -c "julia -e 'using PkgCompiler; PkgCompiler.clear_cache()' && gunicorn -w 1 -b 0.0.0.0:8000 wsgi:server --timeout 200" nginx: diff --git a/flask_api/requirements.txt b/flask_api/requirements.txt index f13cffa..1b72961 100644 --- a/flask_api/requirements.txt +++ b/flask_api/requirements.txt @@ -6,4 +6,5 @@ pylance==0.6.2 flask_restful==0.3.10 juliacall == 0.9.14 psutil == 3.2.2 -gunicorn==21.2.0 \ No newline at end of file +gunicorn==21.2.0 +gevent==24.2.1 \ No newline at end of file diff --git a/streamlit/pages/1_Simulation.py b/streamlit/pages/1_Simulation.py index 9e71dbd..0782e60 100644 --- a/streamlit/pages/1_Simulation.py +++ b/streamlit/pages/1_Simulation.py @@ -37,7 +37,16 @@ # Get page name url = str(st_javascript("await fetch('').then(r => window.parent.location.href)")) -page_name = url.rsplit('/',1)[1] +url_parts = url.rsplit('/',1) + +if len(url_parts) > 1: + # Extract the page name from the last part + page_name = url_parts[1] +else: + # Handle the case where '/' is not found in the URL + page_name = "Unknown" + + def run_page(): diff --git a/streamlit/pages/2_Results.py b/streamlit/pages/2_Results.py index bc94928..5345fee 100644 --- a/streamlit/pages/2_Results.py +++ b/streamlit/pages/2_Results.py @@ -34,7 +34,14 @@ # Get page name url = str(st_javascript("await fetch('').then(r => window.parent.location.href)")) -page_name = url.rsplit('/',1)[1] +url_parts = url.rsplit('/',1) + +if len(url_parts) > 1: + # Extract the page name from the last part + page_name = url_parts[1] +else: + # Handle the case where '/' is not found in the URL + page_name = "Unknown" def run_page():