diff options
author | 2023-01-08 11:43:08 +0000 | |
---|---|---|
committer | 2023-01-08 11:43:08 +0000 | |
commit | 1bda6a2002b18d3732b24d2496b88e137a32968b (patch) | |
tree | 8bfb104d9e7e7035f8ccfb355078466096456ab8 /internal/api/client.go | |
parent | [docs] Rewrite sponsorship + funding section, add NLnet (#1305) (diff) | |
download | gotosocial-1bda6a2002b18d3732b24d2496b88e137a32968b.tar.xz |
[bugfix] return early in websocket upgrade handler (#1315)
* launch websocket streaming in goroutine to allow upgrade handler to return
* don't send any message on ping, improved close check on failed read
* use context to signal wsconn close, ensure canceled in read goroutine
Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'internal/api/client.go')
-rw-r--r-- | internal/api/client.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/api/client.go b/internal/api/client.go index e948d74c5..b365441ef 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -19,6 +19,8 @@ package api import ( + "time" + "github.com/gin-gonic/gin" "github.com/superseriousbusiness/gotosocial/internal/api/client/accounts" "github.com/superseriousbusiness/gotosocial/internal/api/client/admin" @@ -122,7 +124,7 @@ func NewClient(db db.DB, p processing.Processor) *Client { notifications: notifications.New(p), search: search.New(p), statuses: statuses.New(p), - streaming: streaming.New(p), + streaming: streaming.New(p, time.Second*30, 4096), timelines: timelines.New(p), user: user.New(p), } |