Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GitHub warnings #931

Merged
merged 15 commits into from
Feb 17, 2023
Prev Previous commit
Next Next commit
remove some redundant code
  • Loading branch information
localvar committed Feb 8, 2023
commit 7bf022c82c06bba59d79c91fd8ec24721fb39631
26 changes: 14 additions & 12 deletions pkg/object/grpcserver/grpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,10 @@ func (g *GRPCServer) DefaultSpec() interface{} {
}
}

// Status returns the status of GrpcServer.
func (g *GRPCServer) Status() *supervisor.Status {
return &supervisor.Status{
ObjectStatus: g.runtime.Status(),
}
}

// Close close GrpcServer
func (g *GRPCServer) Close() {
g.runtime.Close()
}

// Init first create GrpcServer by Spec.name
func (g *GRPCServer) Init(superSpec *supervisor.Spec, muxMapper context.MuxMapper) {
g.runtime = newRuntime(superSpec, muxMapper)

g.runtime.eventChan <- &eventReload{
nextSuperSpec: superSpec,
muxMapper: muxMapper,
Expand All @@ -83,8 +72,21 @@ func (g *GRPCServer) Init(superSpec *supervisor.Spec, muxMapper context.MuxMappe
// Inherit inherits previous generation of GrpcServer.
func (g *GRPCServer) Inherit(superSpec *supervisor.Spec, previousGeneration supervisor.Object, muxMapper context.MuxMapper) {
g.runtime = previousGeneration.(*GRPCServer).runtime

g.runtime.eventChan <- &eventReload{
nextSuperSpec: superSpec,
muxMapper: muxMapper,
}
}

// Status returns the status of GrpcServer.
func (g *GRPCServer) Status() *supervisor.Status {
return &supervisor.Status{
ObjectStatus: g.runtime.Status(),
}
}

// Close close GrpcServer
func (g *GRPCServer) Close() {
g.runtime.Close()
}
Loading