Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Sep 4, 2023
1 parent ab9a858 commit 102c9e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indexer/blobstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func newBlobStore() *BlobStore {
logger_blobs.Errorf("cannot init blobstore with 'fs' engine: missing path")
break
}
os.Mkdir(utils.Config.BlobStore.Fs.Path, 0755)
store.mode = blobPersistenceModeFs
case "aws":
s3store, err := aws.NewS3Store(utils.Config.BlobStore.Aws.AccessKey, utils.Config.BlobStore.Aws.SecretKey, utils.Config.BlobStore.Aws.S3Region, utils.Config.BlobStore.Aws.S3Bucket)
Expand Down Expand Up @@ -81,10 +82,9 @@ func (store *BlobStore) saveBlob(blob *rpctypes.BlobSidecar, tx *sqlx.Tx) error
dbBlob.Blob = (*[]byte)(&blob.Blob)
case blobPersistenceModeFs:
blobFile := path.Join(utils.Config.BlobStore.Fs.Path, blobName)
os.Mkdir(utils.Config.BlobStore.Fs.Path, 0755)
err := os.WriteFile(blobFile, blob.Blob, 0644)
if err != nil {
return fmt.Errorf("could not open blob file '%v': %w", blobFile, err)
return fmt.Errorf("could not save blob to file '%v': %w", blobFile, err)
}
case blobPersistenceModeAws:
err := store.s3Store.Upload(blobName, blob.Blob)
Expand Down

0 comments on commit 102c9e6

Please sign in to comment.