Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
windycrypto committed Nov 26, 2023
1 parent 93fb843 commit 29b40cc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion relay/pendingSession.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type SortedPendingSessions struct {
type pendingSession struct {
expireTime time.Time
topic string
dapp *client
}

func (pq PendingSessions) Len() int { return len(pq) }
Expand Down
10 changes: 3 additions & 7 deletions relay/wsserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ type WsServer struct {
register chan *client
unregister chan ClientUnregisterEvent

// session maintenance
pendingSessions *SortedPendingSessions

redisConn *redis.Client
redisSubConn *redis.PubSub

Expand All @@ -43,10 +40,9 @@ func NewWSServer(config *config.Config) *WsServer {
ws := &WsServer{
config: &config.WsServerConfig, // config

clients: make(map[*client]struct{}),
register: make(chan *client, 4096),
unregister: make(chan ClientUnregisterEvent, 4096),
pendingSessions: NewSortedPendingSessions(),
clients: make(map[*client]struct{}),
register: make(chan *client, 4096),
unregister: make(chan ClientUnregisterEvent, 4096),

publishers: NewTopicClientSet(),
subscribers: NewTopicClientSet(),
Expand Down

0 comments on commit 29b40cc

Please sign in to comment.