mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-11 18:20:28 +09:00
Change Add to TryAdd
This commit is contained in:
parent
2ea446184d
commit
16be33fc96
2 changed files with 4 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue