Skip to content

Commit

Permalink
fix: the extension cannot run in startup (#356)
Browse files Browse the repository at this point in the history
Co-authored-by: rick <[email protected]>
  • Loading branch information
LinuxSuRen and LinuxSuRen authored Apr 10, 2024
1 parent 4322123 commit cc662bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func createServerCmd(execer fakeruntime.Execer, httpServer server.HTTPServer) (c
flags.StringVarP(&opt.clientSecret, "client-secret", "", os.Getenv("OAUTH_CLIENT_SECRET"), "ClientSecret is the application's secret")
flags.BoolVarP(&opt.dryRun, "dry-run", "", false, "Do not really start a gRPC server")

// gc releated flags
// gc related flags
flags.IntVarP(&opt.gcPercent, "gc-percent", "", 100, "The GC percent of Go")

c.Flags().MarkHidden("dry-run")
Expand Down Expand Up @@ -209,8 +209,6 @@ func (o *serverOption) runE(cmd *cobra.Command, args []string) (err error) {
}

storeExtMgr := server.NewStoreExtManager(o.execer)
defer storeExtMgr.StopAll()

remoteServer := server.NewRemoteServer(loader, remote.NewGRPCloaderFromStore(), secretServer, storeExtMgr, o.configDir)
kinds, storeKindsErr := remoteServer.GetStoreKinds(ctx, nil)
if storeKindsErr != nil {
Expand All @@ -236,6 +234,8 @@ func (o *serverOption) runE(cmd *cobra.Command, args []string) (err error) {

go func() {
<-clean
log.Println("stopping the extensions")
storeExtMgr.StopAll()
log.Println("stopping the server")
_ = lis.Close()
_ = o.httpServer.Shutdown(ctx)
Expand Down

0 comments on commit cc662bd

Please sign in to comment.