Skip to content

Commit

Permalink
🧹 Log err if heartbeat fails. (#4790)
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <[email protected]>
  • Loading branch information
preslavgerchev authored Oct 29, 2024
1 parent e0c5f88 commit 18a3d95
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions providers/running_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,13 @@ func (c *connectionGraph) garbageCollect() []uint32 {
return collected
}

type ReconnectFunc func() (pp.ProviderPlugin, *plugin.Client, error)
type connectReq struct {
req *pp.ConnectReq
cb pp.ProviderCallback
}
type (
ReconnectFunc func() (pp.ProviderPlugin, *plugin.Client, error)
connectReq struct {
req *pp.ConnectReq
cb pp.ProviderCallback
}
)

const maxRestartCount = 3

Expand Down Expand Up @@ -359,6 +361,7 @@ func (p *RunningProvider) doOneHeartbeat(t time.Duration) error {
Interval: uint64(t),
})
if err != nil {
log.Err(err).Str("plugin", p.Name).Msg("error in plugin heartbeat")
if status, ok := status.FromError(err); ok {
if status.Code() == 12 {
return errors.New("please update the provider plugin for " + p.Name)
Expand Down

0 comments on commit 18a3d95

Please sign in to comment.