Skip to content

Commit a8994e7

Browse files
committed
GOSDK-18: Add object error and completed listeners to Strategies in helpers. Removing null pointer scenario from helpers with new error handling. Was trying to access variable from an item that would be null during error checking.
1 parent faee817 commit a8994e7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

helpers/getProducer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ func (producer *getProducer) processWaitingBlobs(bucketName string, jobId string
204204
producer.Debugf("attempting to process '%s' offset=%d length=%d", curBlob.Name(), curBlob.Offset(), curBlob.Length())
205205
if err != nil {
206206
//should not be possible to get here
207-
producer.strategy.Listeners.Errored(curBlob.Name(), err)
208207
producer.Errorf("failure during blob transfer '%s' at offset %d: %s", curBlob.Name(), curBlob.Offset(), err.Error())
208+
break
209209
}
210210
producer.queueBlobForTransfer(curBlob, bucketName, jobId)
211211
}

helpers/putProducer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ func (producer *putProducer) processWaitingBlobs(bucketName string, jobId string
142142
//attempt transfer
143143
curBlob, err := producer.deferredBlobQueue.Pop()
144144
if err != nil {
145-
producer.strategy.Listeners.Errored(curBlob.Name(), err)
145+
//should not be possible to get here
146146
producer.Errorf("problem when getting next blob to be transferred: %s", err.Error())
147-
continue
147+
break
148148
}
149149
producer.Debugf("attempting to process %s offset=%d length=%d", curBlob.Name(), curBlob.Offset(), curBlob.Length())
150150
producer.queueBlobForTransfer(curBlob, bucketName, jobId)

0 commit comments

Comments
 (0)