Skip to content

Commit

Permalink
Wait for internet connection before fetching updates
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Oct 13, 2023
1 parent 957abbb commit bdb0bc5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"flag"
"fmt"
"github.com/vertex-center/vertex/pkg/net"
"os"
"runtime"

Expand Down Expand Up @@ -128,6 +129,13 @@ func setupDependency(dep types.DependencyUpdater) error {
return err
}

// Wait for internet connection
err = net.Wait("google.com:80")
if err != nil {
log.Error(err)
return err
}

// download
_, err = dep.CheckForUpdate(types.SettingsUpdatesChannelStable)
if err != nil && !errors.Is(err, services.ErrDependencyNotInstalled) {
Expand Down

0 comments on commit bdb0bc5

Please sign in to comment.