From e670fd05c2a5a696eeffa447686da7178b07a691 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 6 May 2020 20:11:35 +0300 Subject: Prevent blocking when trying to stop matrix container --- matrix/matrix.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'matrix') diff --git a/matrix/matrix.go b/matrix/matrix.go index 30e28fb..072816d 100644 --- a/matrix/matrix.go +++ b/matrix/matrix.go @@ -278,7 +278,10 @@ func (c *Container) Logout() { func (c *Container) Stop() { if c.running { debug.Print("Stopping Matrix container...") - c.stop <- true + select { + case c.stop <- true: + default: + } c.client.StopSync() debug.Print("Closing history manager...") err := c.history.Close() -- cgit v1.2.3