Skip to content

Commit

Permalink
Do not check the network if the context is canceled
Browse files Browse the repository at this point in the history
  • Loading branch information
aleskandro committed Sep 3, 2024
1 parent a47c4e5 commit e880567
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ func (n *NetworkConnectionReconciler) updateNow() {
func checkNetwork(ctx context.Context) error {
// Wait for the network to be fully connected
for i := 0; i < 10; i++ {
if ctx.Err() != nil {
return ctx.Err()
}
// Check if a web request to google is successful
client := &http.Client{
Timeout: 5 * time.Second,
Expand Down

0 comments on commit e880567

Please sign in to comment.