[#749] morph: Fix panic when closing morph client

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-10-27 15:02:14 +03:00 committed by Evgenii Stratonikov
parent c80b46fad3
commit a26483fc30
5 changed files with 49 additions and 18 deletions

View file

@ -75,6 +75,8 @@ func (c *Client) SwitchRPC(ctx context.Context) bool {
}
func (c *Client) closeWaiter(ctx context.Context) {
c.wg.Add(1)
defer c.wg.Done()
select {
case <-ctx.Done():
case <-c.closeChan: