Skip to content

Commit

Permalink
Merge pull request #1238 from threefoldtech/development_buffer_checki…
Browse files Browse the repository at this point in the history
…ng_not_awake_nodes

set a one hour buffer for waking up nodes
  • Loading branch information
rawdaGastan authored Oct 30, 2024
2 parents 7c659bb + 2e91294 commit e336282
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions farmerbot/internal/farmerbot.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ func (f *FarmerBot) shouldWakeUp(ctx context.Context, node *node, roundStart tim
}

lastTimeNodeUpdatedAt := time.Unix(proxyNode.UpdatedAt, 0)
if time.Since(lastTimeNodeUpdatedAt) > 24*time.Hour {
// if the last time the node was awake was before 24 hours ago
if time.Since(lastTimeNodeUpdatedAt) > 23*time.Hour {
// if the last time the node was awake was before 23 hours ago (One hour to account for DST transitions)
log.Warn().Uint32("nodeID", uint32(node.ID)).Msgf("Node didn't wake up since %v hours", math.Floor(time.Since(lastTimeNodeUpdatedAt).Hours()))
log.Info().Uint32("nodeID", uint32(node.ID)).Msg("Urgent wake up")
node.lastTimePeriodicWakeUp = time.Now()
Expand Down

0 comments on commit e336282

Please sign in to comment.