feat: schedule persistent archive jobs with console management
This commit is contained in:
@@ -21,7 +21,10 @@ func lockJob(root *os.Root) (*os.File, error) {
|
||||
}
|
||||
if err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB); err != nil {
|
||||
f.Close()
|
||||
return nil, errors.New("archive job is locked or filesystem does not support locking")
|
||||
if errors.Is(err, syscall.EWOULDBLOCK) || errors.Is(err, syscall.EAGAIN) {
|
||||
return nil, ErrArchiveBusy
|
||||
}
|
||||
return nil, errors.New("archive filesystem does not support locking")
|
||||
}
|
||||
return f, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user