Skip to content

Commit eac3bb5

Browse files
committed
use take in share info
1 parent 9205fad commit eac3bb5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

code/go/0chain.net/blobbercore/reference/filestats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func FileUpdated(ctx context.Context, refID, newRefID int64) {
8888

8989
func FileBlockDownloaded(ctx context.Context, ref *Ref, blocks int64) {
9090
db := datastore.GetStore().GetTransaction(ctx)
91-
db.Model(ref).Update("num_of_block_downloads", gorm.Expr("num_of_block_downloads + ?", blocks))
91+
db.Unscoped().Model(ref).Update("num_of_block_downloads", gorm.Expr("num_of_block_downloads + ?", blocks))
9292
}
9393

9494
func GetFileStats(ctx context.Context, ref *Ref) (*FileStats, error) {

code/go/0chain.net/blobbercore/reference/shareinfo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func GetShareInfo(ctx context.Context, clientID, filePathHash string) (*ShareInf
8585
ClientID: clientID,
8686
FilePathHash: filePathHash,
8787
}).
88-
First(shareInfo).Error
88+
Take(shareInfo).Error
8989

9090
if err != nil {
9191
return nil, err

0 commit comments

Comments
 (0)