Skip to content

Commit

Permalink
fix: call Config.SetDefaults() (#2229)
Browse files Browse the repository at this point in the history
fixes: #2206
  • Loading branch information
stuartwdouglas authored Aug 1, 2024
1 parent 5b0ecf7 commit b8b5364
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions cmd/ftl-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func main() {
kong.UsageOnError(),
kong.Vars{"version": ftl.Version, "timestamp": time.Unix(t, 0).Format(time.RFC3339)},
)
cli.ControllerConfig.SetDefaults()
ctx := log.ContextWithLogger(context.Background(), log.Configure(os.Stderr, cli.LogConfig))
err = observability.Init(ctx, "ftl-controller", ftl.Version, cli.ObservabilityConfig)
kctx.FatalIfErrorf(err, "failed to initialize observability")
Expand Down
5 changes: 1 addition & 4 deletions cmd/ftl/cmd_box_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net/url"
"time"

"github.com/alecthomas/kong"
"github.com/jpillora/backoff"
"golang.org/x/sync/errgroup"

Expand Down Expand Up @@ -44,9 +43,7 @@ func (b *boxRunCmd) Run(ctx context.Context, projConfig projectconfig.Config) er
Key: model.NewLocalControllerKey(0),
DSN: b.DSN,
}
if err := kong.ApplyDefaults(&config); err != nil {
return err
}
config.SetDefaults()

// Start the controller.
runnerPortAllocator, err := bind.NewBindAllocator(b.RunnerBase)
Expand Down
5 changes: 1 addition & 4 deletions cmd/ftl/cmd_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"time"

"connectrpc.com/connect"
"github.com/alecthomas/kong"
"github.com/alecthomas/types/optional"
"golang.org/x/sync/errgroup"

Expand Down Expand Up @@ -124,9 +123,7 @@ func (s *serveCmd) run(ctx context.Context, projConfig projectconfig.Config, ini
Key: model.NewLocalControllerKey(i),
DSN: dsn,
}
if err := kong.ApplyDefaults(&config); err != nil {
return err
}
config.SetDefaults()
config.ModuleUpdateFrequency = time.Second * 1

scope := fmt.Sprintf("controller%d", i)
Expand Down

0 comments on commit b8b5364

Please sign in to comment.