Skip to content

Commit ac00c75

Browse files
authored
add free check (#1315)
1 parent e25ff0d commit ac00c75

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

storagemanager/storagemanager.go

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ func (m *StorageManager) Free(ctx context.Context) (uint64, error) {
6262
return 0, fmt.Errorf("getting total tagged: %w", err)
6363
}
6464

65+
//Return 0 if user sets this value to lower than currently occupied by deals
66+
if m.Cfg.MaxStagingDealsBytes < tagged {
67+
return 0, nil
68+
}
69+
6570
return m.Cfg.MaxStagingDealsBytes - tagged, nil
6671
}
6772

0 commit comments

Comments
 (0)