Skip to content

Commit

Permalink
agent: log continually for 60s before erroring
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Bond <danbond@protonmail.com>
  • Loading branch information
loshz committed May 12, 2023
1 parent 4332107 commit 2480556
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,11 @@ func (a *Agent) Start(ctx context.Context) error {
// Check for a last seen timestamp and exit if deemed stale before attempting to join
// Serf/Raft or listen for requests.
if err := a.checkServerLastSeen(consul.ReadServerMetadata); err != nil {
// TODO: log a bunch of times first?
deadline := time.Now().Add(time.Minute)
for time.Now().Before(deadline) {
a.logger.Error("startup error: %s", err)
time.Sleep(10 * time.Second)
}
return err
}

Expand Down

0 comments on commit 2480556

Please sign in to comment.