Implement deep copy method for model.WebSocketEvent (#18977)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
0da249c651
Коммит
3dea98ea4b
@@ -735,7 +735,9 @@ func (a *App) publishWebsocketEventForPermalinkPost(post *model.Post, message *m
|
||||
}
|
||||
return false, err
|
||||
}
|
||||
messageCopy := message.Copy()
|
||||
// Using DeepCopy here to avoid a race condition
|
||||
// between publishing the event and setting the "post" data value below.
|
||||
messageCopy := message.DeepCopy()
|
||||
broadcastCopy := messageCopy.GetBroadcast()
|
||||
broadcastCopy.UserId = cm.UserId
|
||||
messageCopy.SetBroadcast(broadcastCopy)
|
||||
|
||||
Ссылка в новой задаче
Block a user