diff --git a/pds.go b/pds.go index fbbc138..cc5c6c3 100644 --- a/pds.go +++ b/pds.go @@ -116,7 +116,11 @@ func (s *service) backupBlobs(ctx context.Context) error { return fmt.Errorf("get all blob CIDs: %w", err) } - filename := fmt.Sprintf("%s-%s-blobs.zip", s.did, time.Now()) + if len(cids) == 0 { + return nil + } + + filename := path.Join(s.blobDir, fmt.Sprintf("%s-%d-blobs.zip", s.did, time.Now().UnixMilli())) defer os.Remove(filename) f, err := os.Create(filename)