diff options
| author | Shulhan <m.shulhan@gmail.com> | 2020-11-26 17:20:31 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2020-11-26 17:20:31 +0700 |
| commit | 0df82da7a8cd0678ed845f2284b7d3f84ba84687 (patch) | |
| tree | b5546d8c9e533d2987a9b9b6981f06b873796a3b | |
| parent | e8b3bf5ee6e9c4a68fb11a1d04aa082c0862a0e1 (diff) | |
| download | pakakeh.go-0df82da7a8cd0678ed845f2284b7d3f84ba84687.tar.xz | |
websocket: create buffered channel for running queue
This is to fix Stop() method waiting for running channel to be consumed.
| -rw-r--r-- | lib/websocket/server.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/websocket/server.go b/lib/websocket/server.go index e57e5b4d..d7d1bb65 100644 --- a/lib/websocket/server.go +++ b/lib/websocket/server.go @@ -74,7 +74,7 @@ func NewServer(opts *ServerOptions) (serv *Server) { opts: opts, Clients: newClientManager(), routes: newRootRoute(), - running: make(chan struct{}), + running: make(chan struct{}, 1), } opts.init() |
