[MM-52550] platform/web_conn: fix a possible data race issue (#23255)
* platform/web_conn: fix a possible data race issue * reflect review comments --------- Co-authored-by: Ibrahim Serdar Acikgoz <ibrahim@ibrahims-mac.local> Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d860548a76
Коммит
d030f681eb
@@ -436,8 +436,9 @@ func (h *Hub) Start() {
|
||||
|
||||
conns := connIndex.ForUser(webConn.UserId)
|
||||
if len(conns) == 0 || areAllInactive(conns) {
|
||||
userID := webConn.UserId
|
||||
h.platform.Go(func() {
|
||||
h.platform.SetStatusOffline(webConn.UserId, false)
|
||||
h.platform.SetStatusOffline(userID, false)
|
||||
})
|
||||
continue
|
||||
}
|
||||
@@ -452,8 +453,9 @@ func (h *Hub) Start() {
|
||||
}
|
||||
|
||||
if h.platform.isUserAway(latestActivity) {
|
||||
userID := webConn.UserId
|
||||
h.platform.Go(func() {
|
||||
h.platform.SetStatusLastActivityAt(webConn.UserId, latestActivity)
|
||||
h.platform.SetStatusLastActivityAt(userID, latestActivity)
|
||||
})
|
||||
}
|
||||
case userID := <-h.invalidateUser:
|
||||
|
||||
Ссылка в новой задаче
Block a user