Skip to content

Commit

Permalink
Do not ping if a panic occurs (#14)
Browse files Browse the repository at this point in the history
* more work

* fix pings
  • Loading branch information
keefertaylor authored Feb 29, 2024
1 parent cd4410d commit bc688ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Binary file added .DS_Store
Binary file not shown.
26 changes: 13 additions & 13 deletions restake/restake_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,6 @@ func (rm *RestakeManager) runRestakeForNetwork(
}
results = append(results, result)

// Send health check if enabled
if !strings.EqualFold(localConfiguration.HealthChecksPingKey, "") {
healthClient := health.NewHealthClient(rm.logger, localConfiguration.HealthChecksPingKey, true)

if err == nil {
err = healthClient.SendSuccess(restakeChain.Name)
} else {
err = healthClient.SendFailure(restakeChain.Name)
}
} else {
rm.logger.Info().Str("chain_id", restakeChain.Name).Msg("not sending healthchecks.io pings as they are disabled in config.")
}

// Leave wait group
defer wg.Done()
}()
Expand Down Expand Up @@ -393,6 +380,19 @@ func (rm *RestakeManager) runRestakeForNetwork(
}

txHashes, err = restakeClient.restake(ctx)

// Send health check if enabled
if !strings.EqualFold(localConfiguration.HealthChecksPingKey, "") {
healthClient := health.NewHealthClient(rm.logger, localConfiguration.HealthChecksPingKey, true)

if err == nil {
err = healthClient.SendSuccess(restakeChain.Name)
} else {
err = healthClient.SendFailure(restakeChain.Name)
}
} else {
rm.logger.Info().Str("chain_id", restakeChain.Name).Msg("not sending healthchecks.io pings as they are disabled in config.")
}
}

// Results of running Restake on a given network
Expand Down

0 comments on commit bc688ff

Please sign in to comment.