Release URBM 2026.06.15.r005

This commit is contained in:
Mikei386
2026-06-15 07:04:41 +02:00
parent b93b06ec20
commit b03f168b78
10 changed files with 99 additions and 14 deletions
+16
View File
@@ -139,6 +139,13 @@ func (r *Runner) Forget(ctx context.Context, repo model.Repository, job model.Jo
if job.Retention.Monthly > 0 {
args = append(args, "--keep-monthly", fmt.Sprint(job.Retention.Monthly))
}
err := r.run(ctx, repo, args, nil, nil)
if err == nil || !isRepositoryLocked(err) {
return err
}
if unlockErr := r.Unlock(ctx, repo); unlockErr != nil {
return fmt.Errorf("retention repository locked; remove stale lock: %w", unlockErr)
}
return r.run(ctx, repo, args, nil, nil)
}
@@ -328,6 +335,15 @@ func resticError(message string, commandErr error) error {
}
}
func isRepositoryLocked(err error) bool {
if err == nil {
return false
}
lower := strings.ToLower(err.Error())
return strings.Contains(lower, "repository is already locked") ||
strings.Contains(lower, "unable to create lock in backend")
}
func repositoryLocation(repo model.Repository) string {
if repo.Type == model.RepositorySFTP && !strings.HasPrefix(repo.Location, "sftp:") {
return "sftp:" + repo.Location