forked from TrueCloudLab/frostfs-node
[#323] cmd/node: Compose functions for closing components in app
Closing callback can be registered in app through onShutdown method. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
707434efa9
commit
9f41192bff
4 changed files with 29 additions and 4 deletions
|
@ -62,6 +62,10 @@ func initControlService(c *cfg) {
|
|||
c.cfgControlService.server = grpc.NewServer()
|
||||
}
|
||||
|
||||
c.onShutdown(func() {
|
||||
stopGRPC("NeoFS Control API", c.cfgControlService.server, c.log)
|
||||
})
|
||||
|
||||
control.RegisterControlServiceServer(c.cfgControlService.server, ctlSvc)
|
||||
|
||||
c.workers = append(c.workers, newWorkerFromFunc(func(ctx context.Context) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue