Add a delay before unmounting the image.

This should speed up Conty startup time significantly when executing multiple instances of Conty in a row.
This commit is contained in:
Kron4ek 2023-06-10 16:00:21 +05:00
parent c54e734987
commit ba3737aa3d

View file

@ -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
}