mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
refactor(cli): avoid importing coderd in slim server (#9483)
This small change removes 11 MB from the slim binary size. Ref: #9380
This commit is contained in:
@@ -306,6 +306,13 @@ func enablePrometheus(
|
||||
}
|
||||
|
||||
func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.API, io.Closer, error)) *clibase.Cmd {
|
||||
if newAPI == nil {
|
||||
newAPI = func(_ context.Context, o *coderd.Options) (*coderd.API, io.Closer, error) {
|
||||
api := coderd.New(o)
|
||||
return api, api, nil
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
vals = new(codersdk.DeploymentValues)
|
||||
opts = vals.Options()
|
||||
|
||||
Reference in New Issue
Block a user