this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

improvements from review

+8 -3
+2
splitter/firehose.go
··· 26 26 since = &sval 27 27 } 28 28 29 + // NOTE: the request context outlives the HTTP 101 response; it lives as long as the WebSocket is open, and then get cancelled. That is the behavior we want for this ctx, but should be careful if spawning goroutines which should outlive the WebSocket connection. 30 + // https://github.com/bluesky-social/indigo/pull/1023#pullrequestreview-2768335762 29 31 ctx, cancel := context.WithCancel(c.Request().Context()) 30 32 defer cancel() 31 33
+6 -3
splitter/handlers.go
··· 66 66 67 67 // if that was successful, then forward on to the other upstreams (in goroutines) 68 68 for _, c := range s.nextCrawlers { 69 + // intentional local copy of loop variable 70 + hostname := c.String() 69 71 go func() { 72 + // new context to outlive original HTTP request 70 73 ctx := context.Background() 71 74 xrpcc := xrpc.Client{ 72 75 Client: s.upstreamClient, 73 - Host: c.String(), 76 + Host: hostname, 74 77 } 75 78 if err := comatproto.SyncRequestCrawl(ctx, &xrpcc, &body); err != nil { 76 - s.logger.Warn("failed to forward requestCrawl", "upstream", c.String(), "targetHost", body.Hostname, "err", err) 79 + s.logger.Warn("failed to forward requestCrawl", "upstream", hostname, "targetHost", body.Hostname, "err", err) 77 80 } 78 - s.logger.Info("successfully forwarded requestCrawl", "upstream", c.String(), "targetHost", body.Hostname) 81 + s.logger.Info("successfully forwarded requestCrawl", "upstream", hostname, "targetHost", body.Hostname) 79 82 }() 80 83 } 81 84