mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
ping the capabilities API when the loop starts (#8005)
This commit is contained in:
parent
7cdc2e2027
commit
b165c5217e
1 changed files with 6 additions and 2 deletions
|
|
@ -861,11 +861,15 @@ func (f *capabilitiesChecker) actor() (func() error, func(error)) {
|
|||
// You need to add an explicit check for each capability you want to watch for
|
||||
func (f *capabilitiesChecker) execute() error {
|
||||
defer close(f.executeDoneCh)
|
||||
capabilitiesCHeckTicker := time.NewTicker(5 * time.Minute)
|
||||
capabilitiesCheckTicker := time.NewTicker(5 * time.Minute)
|
||||
|
||||
if err := f.client.Ping(); err != nil {
|
||||
log.Error().Err(err).Msg("pinging the server")
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-capabilitiesCHeckTicker.C:
|
||||
case <-capabilitiesCheckTicker.C:
|
||||
oldCapabilities := f.client.GetServerCapabilities()
|
||||
// ping the server to get the latest capabilities
|
||||
if err := f.client.Ping(); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue