Skip to content

Commit

Permalink
fix: PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
joanestebanr committed Dec 9, 2024
1 parent 46b807e commit f96eba2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions aggsender/block_notifier_polling.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
)

var (
timeNowFunc = time.Now
percentForNextBlock = 80
timeNowFunc = time.Now
)

const (
Expand All @@ -22,6 +21,8 @@ const (
minBlockInterval = time.Second
// maxBlockInterval is the maximum interval at which the AggSender will check for new blocks
maxBlockInterval = time.Minute
// Percentage period of reach the next block
percentForNextBlock = 80
)

type ConfigBlockNotifierPolling struct {
Expand Down Expand Up @@ -187,7 +188,7 @@ func (b *BlockNotifierPolling) nextBlockRequestDelay(status *blockNotifierPollin
now := timeNowFunc()
expectedTimeNextBlock := status.lastBlockTime.Add(*status.previousBlockTime)
distanceToNextBlock := expectedTimeNextBlock.Sub(now)
interval := distanceToNextBlock * time.Duration(percentForNextInterval) / 100 //nolint:mnd // percent periodfor reach the next block
interval := distanceToNextBlock * time.Duration(percentForNextInterval) / 100 //nolint:mnd // percent period for reach the next block

Check failure on line 191 in aggsender/block_notifier_polling.go

View workflow job for this annotation

GitHub Actions / lint

undefined: percentForNextInterval) (typecheck)

Check failure on line 191 in aggsender/block_notifier_polling.go

View workflow job for this annotation

GitHub Actions / lint

undefined: percentForNextInterval (typecheck)

Check failure on line 191 in aggsender/block_notifier_polling.go

View workflow job for this annotation

GitHub Actions / lint

undefined: percentForNextInterval) (typecheck)

Check failure on line 191 in aggsender/block_notifier_polling.go

View workflow job for this annotation

GitHub Actions / test-unit (1.22.4, amd64)

undefined: percentForNextInterval
return max(minBlockInterval, min(maxBlockInterval, interval))
}

Expand Down

0 comments on commit f96eba2

Please sign in to comment.