Skip to content

Commit 684ad73

Browse files
authored
Merge pull request #782 from AyaIbrahimm/master
moved pubq init cond to server constructor
2 parents cde0ef7 + ebc8c97 commit 684ad73

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

internal/server/pubqueue.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ func (s *Server) startPublishQueue(wg *sync.WaitGroup) {
2222
defer wg.Done()
2323
var buf []byte
2424
var conns []net.Conn
25-
s.pubq.cond = sync.NewCond(&sync.Mutex{})
2625
s.pubq.cond.L.Lock()
2726
for {
2827
for len(s.pubq.entries) > 0 {

internal/server/server.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ func Serve(opts Options) error {
321321
conns: make(map[int]*Client),
322322
http: opts.UseHTTP,
323323
pubsub: newPubsub(),
324+
pubq: pubQueue{cond: sync.NewCond(&sync.Mutex{})},
324325
monconns: make(map[net.Conn]bool),
325326
cols: &btree.Map[string, *collection.Collection]{},
326327

0 commit comments

Comments
 (0)