Use per-user lock file when unlocking

This commit is contained in:
Daniel
2022-10-11 14:49:27 +02:00
parent 1144ac589b
commit 694dfb5b46
2 changed files with 22 additions and 19 deletions

View File

@@ -172,7 +172,7 @@ func run(opts *Options, cmdArgs []string) (err error) {
return fmt.Errorf("another instance of %s is already running: PID %d", opts.Name, pid)
}
defer func() {
err := deleteInstanceLock(opts.LockPathPrefix, opts.ShortIdentifier)
err := deleteInstanceLock(opts.LockPathPrefix, opts.ShortIdentifier, opts.LockPerUser)
if err != nil {
log.Printf("failed to delete instance lock: %s\n", err)
}