From 7d480c9bf55d13045c576fc948722c13906e4453 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 28 Feb 2024 19:12:14 -0300 Subject: [PATCH] Add delete_temp function to cleanup temp database --- src/frontend/run-tests.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/frontend/run-tests.sh b/src/frontend/run-tests.sh index 78e0ee55c..ac6117ad6 100755 --- a/src/frontend/run-tests.sh +++ b/src/frontend/run-tests.sh @@ -27,8 +27,16 @@ terminate_process_by_port() { echo "Process terminated." } +delete_temp() { + cd ../../ + echo "Deleting temp database" + rm temp + echo "Temp database deleted." +} + + # Trap signals to ensure cleanup on script termination -trap 'terminate_process_by_port 7860; terminate_process_by_port 3000' EXIT +trap 'terminate_process_by_port 7860; terminate_process_by_port 3000; delete_temp' EXIT # install playwright if there is not installed yet npx playwright install @@ -46,7 +54,7 @@ sleep 10 poetry install --extras deploy # Start the backend using 'make backend' in the background -LANGFLOW_DATABASE_URL=sqlite:// LANGFLOW_AUTO_LOGIN=True poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser & +LANGFLOW_DATABASE_URL=sqlite:///./temp LANGFLOW_AUTO_LOGIN=True poetry run langflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser & # Give some time for the backend to start (adjust sleep duration as needed) sleep 25