[#1465] node: Prevent process from killing by systemd when shutting down

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-01-27 18:12:03 +03:00 committed by fyrchik
parent 362f24953a
commit 85cf1f47ac
5 changed files with 104 additions and 74 deletions

View file

@ -126,7 +126,20 @@ func (c *Client) notificationLoop() {
continue
}
c.notifications <- n
select {
case c.notifications <- n:
continue
case <-c.cfg.ctx.Done():
_ = c.UnsubscribeAll()
c.close()
return
case <-c.closeChan:
_ = c.UnsubscribeAll()
c.close()
return
}
}
}
}