Skip to content

Commit

Permalink
feat(engine): log if 401/403 on signin (#5974)
Browse files Browse the repository at this point in the history
* feat: log if 401/403 on signin

Signed-off-by: Yvonnick Esnault <[email protected]>
  • Loading branch information
yesnault authored Oct 19, 2021
1 parent b629b7e commit 4fd6f0d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions engine/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,20 @@ func (c *Common) Signin(ctx context.Context, cfg cdsclient.ServiceConfig) error
return err
}

var lasterr error
if err := initClient(ctxTimeout); err != nil {
lasterr = err
loop:
for {
select {
case <-ctxTimeout.Done():
if lasterr != nil {
fmt.Printf("Timeout after 5min - last error: %v\n", lasterr)
}
return ctxTimeout.Err()
case <-ticker.C:
if err := initClient(ctxTimeout); err == nil {
lasterr = err //lint:ignore SA4006 false positive
break loop
}
}
Expand Down

0 comments on commit 4fd6f0d

Please sign in to comment.