avoid divide by zero when hubs not created before first websocket msg (#22315)
Этот коммит содержится в:
@@ -121,6 +121,10 @@ func (ps *PlatformService) HubStop() {
|
|||||||
|
|
||||||
// GetHubForUserId returns the hub for a given user id.
|
// GetHubForUserId returns the hub for a given user id.
|
||||||
func (ps *PlatformService) GetHubForUserId(userID string) *Hub {
|
func (ps *PlatformService) GetHubForUserId(userID string) *Hub {
|
||||||
|
if len(ps.hubs) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: check if caching the userID -> hub mapping
|
// TODO: check if caching the userID -> hub mapping
|
||||||
// is worth the memory tradeoff.
|
// is worth the memory tradeoff.
|
||||||
// https://mattermost.atlassian.net/browse/MM-26629.
|
// https://mattermost.atlassian.net/browse/MM-26629.
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user