From ba3737aa3d6a200fc4464c699a677d969fbfcfb3 Mon Sep 17 00:00:00 2001 From: Kron4ek Date: Sat, 10 Jun 2023 16:00:21 +0500 Subject: [PATCH] Add a delay before unmounting the image. This should speed up Conty startup time significantly when executing multiple instances of Conty in a row. --- conty-start.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conty-start.sh b/conty-start.sh index 7f6851c..01ce14e 100755 --- a/conty-start.sh +++ b/conty-start.sh @@ -762,7 +762,9 @@ run_bwrap () { "$@" } -trap_exit () { +exit_function () { + sleep 5 + rm -f "${working_dir}"/running_"${script_id}" if [ ! "$(ls "${working_dir}"/running_* 2>/dev/null)" ]; then @@ -780,6 +782,10 @@ trap_exit () { rm -rf "${working_dir}" fi fi +} + +trap_exit () { + exit_function & exit }