add debug model
This commit is contained in:
parent
129a9e768d
commit
77ee2d8712
14
service.go
14
service.go
|
@ -258,6 +258,20 @@ func (app *application) preStart() (err error) {
|
||||||
app.Handle("/-/healthy", func(ctx Context) (err error) {
|
app.Handle("/-/healthy", func(ctx Context) (err error) {
|
||||||
return ctx.Success(app.Healthy())
|
return ctx.Success(app.Healthy())
|
||||||
}, WithHandleDescription("Display application healthy"))
|
}, WithHandleDescription("Display application healthy"))
|
||||||
|
|
||||||
|
if !app.opts.DisableCommand {
|
||||||
|
if app.command != nil {
|
||||||
|
app.command.Handle("/-/debug", "Toggle debug model", func(ctx *cli.Context) (err error) {
|
||||||
|
var (
|
||||||
|
bv bool
|
||||||
|
)
|
||||||
|
if bv, err = strconv.ParseBool(ctx.Argument(0)); err == nil {
|
||||||
|
Debug(bv)
|
||||||
|
}
|
||||||
|
return ctx.Success(Debug())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
app.plugins.Range(func(key, value any) bool {
|
app.plugins.Range(func(key, value any) bool {
|
||||||
if plugin, ok := value.(Plugin); ok {
|
if plugin, ok := value.(Plugin); ok {
|
||||||
|
|
Loading…
Reference in New Issue