gh-91: Time limited lock acquire

pull/100/merge
Vlastimil Holer 7 years ago
parent aa3a9f2b4a
commit d2ac18fa8a
No known key found for this signature in database
GPG Key ID: EB549BADEFD07C53

@ -216,6 +216,8 @@ function run_context {
}
function acquire_lock {
local _retry=120
# acquire for execution lock
log debug "Acquiring lock ${LOCK_FILE}"
while true; do
@ -225,6 +227,12 @@ function acquire_lock {
break
fi
_retry=$((_retry - 1))
if [ ${_retry} -le 0 ]; then
log err "Error: Could not acquire lock ${LOCK_FILE}" 2
exit 1
fi
sleep 1
done
}

Loading…
Cancel
Save