Change Add to TryAdd
This commit is contained in:
parent
2ea446184d
commit
16be33fc96
@ -2,6 +2,7 @@ package synctree
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/anyproto/any-sync/app/logger"
|
||||
"github.com/anyproto/any-sync/commonspace/object/tree/objecttree"
|
||||
"github.com/anyproto/any-sync/commonspace/object/tree/treechangeproto"
|
||||
|
||||
@ -2,11 +2,12 @@ package streampool
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/anyproto/any-sync/app/logger"
|
||||
"github.com/cheggaaa/mb/v3"
|
||||
"go.uber.org/zap"
|
||||
"storj.io/drpc"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
type stream struct {
|
||||
@ -22,7 +23,7 @@ type stream struct {
|
||||
}
|
||||
|
||||
func (sr *stream) write(msg drpc.Message) (err error) {
|
||||
return sr.queue.Add(sr.stream.Context(), msg)
|
||||
return sr.queue.TryAdd(sr.stream.Context(), msg)
|
||||
}
|
||||
|
||||
func (sr *stream) readLoop() error {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user