Skip to content

Commit 6fe5278

Browse files
committed
wb | disable lockfile for the "nomadexec" backend
1 parent 862cdad commit 6fe5278

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

nix/workbench/lib.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,14 @@ wait_internal () {
334334
# )
335335
#
336336
acquire_lock() {
337-
WB_LOCKFILE=${WB_LOCKFILE:-/tmp/workbench.lock}
338-
info lockfile "$(white "waiting to acquire the lock on ${WB_LOCKFILE}")"
339-
exec {lock_fd}>"$WB_LOCKFILE"
340-
flock $lock_fd
341-
info lockfile "$(green "lock acquired")"
337+
# Nomad Exec does not support current lockfile implementation.
338+
# Nomad Exec is a local test environment for "nomadcloud" and needs `sudo`.
339+
if test "${WB_BACKEND}" != "nomadexec"
340+
then
341+
WB_LOCKFILE=${WB_LOCKFILE:-/tmp/workbench.lock}
342+
info lockfile "$(white "waiting to acquire the lock on ${WB_LOCKFILE}")"
343+
exec {lock_fd}>"$WB_LOCKFILE"
344+
flock $lock_fd
345+
info lockfile "$(green "lock acquired")"
346+
fi
342347
}

0 commit comments

Comments
 (0)