Skip to content

Commit

Permalink
Update blox.go
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan6sha committed Mar 21, 2024
1 parent 21d2b3a commit 3083d5d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions blox/blox.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,16 @@ func (p *Blox) Start(ctx context.Context) error {
}

// Call HandleManifestBatchStore method
_, err = p.bl.HandleManifestBatchStore(context.TODO(), p.topicName, storedLinks)
if strings.Contains(err.Error(), "AccountAlreadyStorer") {
// Log the occurrence of the specific error but do not continue
log.Warnw("Attempt to store with an account that is already a storer", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks)
} else {
// For any other error, log and continue
log.Errorw("Error calling HandleManifestBatchStore", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks)
continue
if len(storedLinks) > 0 {
_, err = p.bl.HandleManifestBatchStore(context.TODO(), p.topicName, storedLinks)
if strings.Contains(err.Error(), "AccountAlreadyStorer") {
// Log the occurrence of the specific error but do not continue
log.Warnw("Attempt to store with an account that is already a storer", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks)
} else {
// For any other error, log and continue
log.Errorw("Error calling HandleManifestBatchStore", "err", err, "p.topicName", p.topicName, "storedLinks", storedLinks)
continue
}
}
}

Expand Down

0 comments on commit 3083d5d

Please sign in to comment.