mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 14:07:02 +09:00
handle replies in separate thread
This commit is contained in:
parent
80c8da8cac
commit
a2765a5233
2 changed files with 12 additions and 5 deletions
|
@ -80,13 +80,13 @@ func (s *objectSync) HandleMessage(ctx context.Context, senderId string, message
|
|||
return s.messagePool.HandleMessage(ctx, senderId, message)
|
||||
}
|
||||
|
||||
func (s *objectSync) handleMessage(ctx context.Context, senderId string, message *spacesyncproto.ObjectSyncMessage) (err error) {
|
||||
log.With(zap.String("objectId", message.ObjectId), zap.String("replyId", message.ReplyId)).DebugCtx(ctx, "handling message")
|
||||
obj, err := s.objectGetter.GetObject(ctx, message.ObjectId)
|
||||
func (s *objectSync) handleMessage(ctx context.Context, senderId string, msg *spacesyncproto.ObjectSyncMessage) (err error) {
|
||||
log.With(zap.String("objectId", msg.ObjectId), zap.String("replyId", msg.ReplyId)).DebugCtx(ctx, "handling message")
|
||||
obj, err := s.objectGetter.GetObject(ctx, msg.ObjectId)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
return obj.HandleMessage(ctx, senderId, message)
|
||||
return obj.HandleMessage(ctx, senderId, msg)
|
||||
}
|
||||
|
||||
func (s *objectSync) MessagePool() MessagePool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue