Skip to content

Commit

Permalink
use the closest region to the user, if it's not set
Browse files Browse the repository at this point in the history
  • Loading branch information
billyb2 committed Aug 28, 2024
1 parent 18a2a08 commit b5326e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/build/imgsrc/depot.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ func initBuilder(ctx context.Context, buildState *build, appName string, streams
region = regionEnv
}

if region == "" {
closestRegion, err := apiClient.GetNearestRegion(ctx)
if err == nil {
region = closestRegion.Code
}
}

if region != "" {
region = "fly-" + region
}
Expand Down

0 comments on commit b5326e4

Please sign in to comment.