[#6136] added warning logs in case of mismatched modernc deps
This commit is contained in:
@@ -12,7 +12,9 @@ import (
|
||||
"github.com/fatih/color"
|
||||
"github.com/pocketbase/pocketbase/cmd"
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
"github.com/pocketbase/pocketbase/tools/hook"
|
||||
"github.com/pocketbase/pocketbase/tools/list"
|
||||
"github.com/pocketbase/pocketbase/tools/routine"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
_ "github.com/pocketbase/pocketbase/migrations"
|
||||
@@ -137,6 +139,24 @@ func NewWithConfig(config Config) *PocketBase {
|
||||
// hide the default help command (allow only `--help` flag)
|
||||
pb.RootCmd.SetHelpCommand(&cobra.Command{Hidden: true})
|
||||
|
||||
// https://github.com/pocketbase/pocketbase/issues/6136
|
||||
pb.OnBootstrap().Bind(&hook.Handler[*core.BootstrapEvent]{
|
||||
Id: ModerncDepsCheckHookId,
|
||||
Func: func(be *core.BootstrapEvent) error {
|
||||
if err := be.Next(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// run separately to avoid blocking
|
||||
logger := be.App.Logger()
|
||||
routine.FireAndForget(func() {
|
||||
checkModerncDeps(logger)
|
||||
})
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
|
||||
return pb
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user