Skip to content

Commit

Permalink
Merge pull request #808 from nildar/master
Browse files Browse the repository at this point in the history
fix scope of the 'err' variable
  • Loading branch information
canercidam authored Sep 19, 2023
2 parents c2c6b86 + 0d971b7 commit ab20092
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions services/publisher/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,20 +292,20 @@ func (pub *Publisher) publishNextBatch(batch *protocol.AlertBatch) (published bo
return false, err
}

if err != nil {
logger.WithError(err).Error("failed to sign cid")
return false, err
}

scannerAddr := pub.cfg.Key.Address.Hex()

var resp *domain.AlertBatchResponse
for i := 0; i < defaultBatchSendRetryTimes; i++ {
scannerJwt, err := security.CreateScannerJWT(
var scannerJwt string
scannerJwt, err = security.CreateScannerJWT(
pub.cfg.Key, map[string]interface{}{
"batch": cid,
},
)
if err != nil {
logger.WithError(err).Error("failed to sign cid")
return false, err
}
resp, err = pub.alertClient.PostBatch(&domain.AlertBatchRequest{
Scanner: scannerAddr,
ChainID: int64(batch.ChainId),
Expand Down

0 comments on commit ab20092

Please sign in to comment.