Skip to content

Commit f309330

Browse files
committed
Finilize rebase
1 parent 2fe6048 commit f309330

File tree

4 files changed

+9
-40
lines changed

4 files changed

+9
-40
lines changed

pkg/message/msg.go

Lines changed: 0 additions & 26 deletions
This file was deleted.

pkg/msg/msg.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package msg
22

33
import (
44
"encoding/json"
5-
6-
"github.com/rs/zerolog/log"
75
)
86

97
const (
@@ -44,7 +42,6 @@ func (m *Msg) Encode() []byte {
4442
m.Args,
4543
})
4644
if err != nil {
47-
log.Error().Msgf("Fail to encode Msg %v, %s", m, err.Error())
4845
return []byte{}
4946
}
5047
return s

pkg/routing/client.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ func NewClient(hub *Hub, w http.ResponseWriter, r *http.Request) {
8787
log.Info().Msgf("New authenticated connection: %s", client.UID)
8888
}
8989

90-
hub.handleSubscribe(&Request{
91-
client: client,
92-
Request: msg.Request{
93-
Streams: parseStreamsFromURI(r.RequestURI),
94-
},
95-
})
96-
9790
metrics.RecordHubClientNew()
9891

9992
// Allow collection of memory referenced by the caller by doing all work in

pkg/routing/hub.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,11 @@ func (h *Hub) handleSubscribePublic(client IClient, streams []string) {
304304
h.PublicTopics[t] = topic
305305
}
306306

307-
topic.subscribe(client)
308-
client.SubscribePublic(t)
307+
if topic.subscribe(client) {
308+
client.SubscribePublic(t)
309+
metrics.RecordHubSubscription("public", t)
310+
}
311+
309312
if isIncrementObject(t) {
310313
o, ok := h.IncrementalObjects[t]
311314
if ok && o.Snapshot != "" {
@@ -332,8 +335,10 @@ func (h *Hub) handleSubscribePrivate(client IClient, uid string, streams []strin
332335
uTopics[t] = topic
333336
}
334337

335-
topic.subscribe(client)
336-
client.SubscribePrivate(t)
338+
if topic.subscribe(client) {
339+
client.SubscribePrivate(t)
340+
metrics.RecordHubSubscription("private", t)
341+
}
337342
}
338343
}
339344

0 commit comments

Comments
 (0)