diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-05-06 20:11:35 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-05-06 20:11:35 +0300 |
commit | e670fd05c2a5a696eeffa447686da7178b07a691 (patch) | |
tree | 2813ca234f2b6dbe98e3b0f36063164e69096d9a | |
parent | 5b3e91524e000fe07fe30eff70061c9dd796014e (diff) |
Prevent blocking when trying to stop matrix container
-rw-r--r-- | matrix/matrix.go | 5 |
1 files changed, 4 insertions, 1 deletions
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() |