[#476] cmd/containter: Make network handlers async
Make container handlers that do network communication execute asynchronously. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
a04f40d616
commit
f02de33f8b
1 changed files with 2 additions and 2 deletions
|
@ -106,14 +106,14 @@ func initContainerService(c *cfg) {
|
|||
)
|
||||
|
||||
setContainerNotificationParser(c, startEstimationNotifyEvent, containerEvent.ParseStartEstimation)
|
||||
addContainerNotificationHandler(c, startEstimationNotifyEvent, func(ev event.Event) {
|
||||
addContainerAsyncNotificationHandler(c, startEstimationNotifyEvent, func(ev event.Event) {
|
||||
ctrl.Start(loadcontroller.StartPrm{
|
||||
Epoch: ev.(containerEvent.StartEstimation).Epoch(),
|
||||
})
|
||||
})
|
||||
|
||||
setContainerNotificationParser(c, stopEstimationNotifyEvent, containerEvent.ParseStopEstimation)
|
||||
addContainerNotificationHandler(c, stopEstimationNotifyEvent, func(ev event.Event) {
|
||||
addContainerAsyncNotificationHandler(c, stopEstimationNotifyEvent, func(ev event.Event) {
|
||||
ctrl.Stop(loadcontroller.StopPrm{
|
||||
Epoch: ev.(containerEvent.StopEstimation).Epoch(),
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue