[MM-29441] Fix errcheck issues in web_hub.go (#29614)

* fix errcheck for web_hub.go

* log user id
Этот коммит содержится в:
Yahya Haq
2024-12-23 14:39:50 +05:00
коммит произвёл GitHub
родитель 3b125a4564
Коммит 0482b57bf8
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@@ -96,7 +96,6 @@ issues:
channels/app/platform/session.go|\
channels/app/platform/status.go|\
channels/app/platform/web_broadcast_hook.go|\
channels/app/platform/web_hub.go|\
channels/app/platform/web_hub_test.go|\
channels/app/plugin_test.go|\
channels/app/post_helpers_test.go|\

Просмотреть файл

@@ -150,7 +150,10 @@ func (ps *PlatformService) GetHubForUserId(userID string) *Hub {
// https://mattermost.atlassian.net/browse/MM-26629.
var hash maphash.Hash
hash.SetSeed(ps.hashSeed)
hash.Write([]byte(userID))
_, err := hash.Write([]byte(userID))
if err != nil {
ps.logger.Error("Unable to write userID to hash", mlog.String("userID", userID), mlog.Err(err))
}
index := hash.Sum64() % uint64(len(ps.hubs))
return ps.hubs[int(index)]