feat: schedule persistent archive jobs with console management

This commit is contained in:
2026-09-23 11:29:32 +08:00
parent 6eb429e21f
commit 0140c78ea7
32 changed files with 2077 additions and 20 deletions

View File

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