summaryrefslogtreecommitdiff
path: root/internal/api/client/streaming/stream.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-09-01 18:29:25 +0200
committerLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-09-01 18:29:25 +0200
commit4696e1a7b389599fa981f334b343daa911b11f5d (patch)
treed1ca0c896cdacb82ad7c64ee150aa32b37d4c053 /internal/api/client/streaming/stream.go
parentmove oauth models into gtsmodel (diff)
downloadgotosocial-4696e1a7b389599fa981f334b343daa911b11f5d.tar.xz
moving stuff around
Diffstat (limited to 'internal/api/client/streaming/stream.go')
-rw-r--r--internal/api/client/streaming/stream.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/api/client/streaming/stream.go b/internal/api/client/streaming/stream.go
index fa210e8d8..4a9dcfe52 100644
--- a/internal/api/client/streaming/stream.go
+++ b/internal/api/client/streaming/stream.go
@@ -146,13 +146,13 @@ func (m *Module) StreamGETHandler(c *gin.Context) {
}
defer conn.Close() // whatever happens, when we leave this function we want to close the websocket connection
- // inform the processor that we have a new connection and want a stream for it
- stream, errWithCode := m.processor.OpenStreamForAccount(c.Request.Context(), account, streamType)
+ // inform the processor that we have a new connection and want a s for it
+ s, errWithCode := m.processor.OpenStreamForAccount(c.Request.Context(), account, streamType)
if errWithCode != nil {
c.JSON(errWithCode.Code(), errWithCode.Safe())
return
}
- defer close(stream.Hangup) // closing stream.Hangup indicates that we've finished with the connection (the client has gone), so we want to do this on exiting this handler
+ defer close(s.Hangup) // closing stream.Hangup indicates that we've finished with the connection (the client has gone), so we want to do this on exiting this handler
// spawn a new ticker for pinging the connection periodically
t := time.NewTicker(30 * time.Second)
@@ -161,7 +161,7 @@ func (m *Module) StreamGETHandler(c *gin.Context) {
sendLoop:
for {
select {
- case m := <-stream.Messages:
+ case m := <-s.Messages:
// we've got a streaming message!!
l.Trace("received message from stream")
if err := conn.WriteJSON(m); err != nil {