Исправление "двоения" ErrNotFound x2

This commit is contained in:
2025-10-30 01:54:30 +03:00
parent 644a94656a
commit 99764eb91f
5 changed files with 28 additions and 24 deletions

10
api.go
View File

@@ -4,9 +4,6 @@ import (
"context"
"errors"
"fmt"
"gitea.unprism.ru/KRBL/Agate/archive"
"gitea.unprism.ru/KRBL/Agate/interfaces"
"gitea.unprism.ru/KRBL/Agate/remote"
"io"
"log"
"os"
@@ -14,6 +11,11 @@ import (
"sync"
"time"
"gitea.unprism.ru/KRBL/Agate/archive"
"gitea.unprism.ru/KRBL/Agate/interfaces"
"gitea.unprism.ru/KRBL/Agate/models"
"gitea.unprism.ru/KRBL/Agate/remote"
"gitea.unprism.ru/KRBL/Agate/store"
"gitea.unprism.ru/KRBL/Agate/stores"
)
@@ -480,7 +482,7 @@ func (ag *Agate) RegisterLocalSnapshot(ctx context.Context, snapshotID, parentID
return nil // Snapshot already exists
}
// We expect ErrNotFound, anything else is a real error.
if !errors.Is(err, ErrNotFound) {
if !errors.Is(err, models.ErrNotFound) {
return fmt.Errorf("failed to check for existing snapshot: %w", err)
}