Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ec9432d7b | |||
| 044d49a9dc |
@@ -1,5 +1,5 @@
|
||||
package constants
|
||||
|
||||
const Version = "0.0.4b"
|
||||
const Version = "0.0.4c"
|
||||
|
||||
const ApiVersion = 1
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"cloudsave/pkg/remote/client"
|
||||
"cloudsave/pkg/repository"
|
||||
"cloudsave/pkg/tools/archive"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -134,6 +135,9 @@ func (s *Service) MakeBackup(gameID string) error {
|
||||
|
||||
src, err := s.repo.ReadBlob(id)
|
||||
if err != nil {
|
||||
if errors.Is(err, repository.ErrNotFound) {
|
||||
return nil
|
||||
}
|
||||
return err
|
||||
}
|
||||
if v, ok := src.(io.Closer); ok {
|
||||
|
||||
@@ -313,6 +313,9 @@ func (l *LazyRepository) ReadBlob(id Identifier) (io.ReadSeekCloser, error) {
|
||||
slog.Debug("loading read buffer...", "id", id)
|
||||
dst, err := os.OpenFile(filepath.Join(path, "data.tar.gz"), os.O_RDONLY, 0)
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return nil, fmt.Errorf("failed to open blob: %w", ErrNotFound)
|
||||
}
|
||||
return nil, fmt.Errorf("failed to open blob: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user