Skip to content

Commit a5bcf41

Browse files
committed
change wait condition
1 parent 77e6385 commit a5bcf41

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

code/go/0chain.net/blobbercore/filestore/tree_validation.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,8 @@ func (c *CommitHasher) Start(ctx context.Context, connID, allocID, fileName, fil
454454
default:
455455
}
456456
toFinalize = true
457+
} else if pq.DataBytes == 0 {
458+
continue
457459
}
458460
logging.Logger.Info("hasher_pop", zap.Int64("offset", pq.Offset), zap.Int64("dataBytes", pq.DataBytes), zap.Any("toFinalize", toFinalize), zap.Int64("dataSize", c.dataSize), zap.String("filename", fileName), zap.Int64("totalWritten", totalWritten))
459461
bufSize := 2 * BufferSize

code/go/0chain.net/blobbercore/seqpriorityqueue/seqpriorityqueue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (pq *SeqPriorityQueue) Done(v UploadData) {
7878

7979
func (pq *SeqPriorityQueue) Popup() UploadData {
8080
pq.lock.Lock()
81-
for pq.queue.Len() == 0 && !pq.done || (pq.queue.Len() > 0 && pq.queue[0].Offset > pq.next) {
81+
for pq.queue.Len() == 0 || (!pq.done && pq.queue[0].Offset > pq.next) {
8282
pq.cv.Wait()
8383
}
8484
if pq.done {

0 commit comments

Comments
 (0)