mirror of
https://github.com/mattermost/mattermost.git
synced 2026-10-31 07:32:52 +08:00
MM-33402: Handles cache invalidation error.
This commit is contained in:
+4
-1
@@ -1029,10 +1029,13 @@ func (a *App) PatchChannelModerationsForChannel(channel *model.Channel, channelM
|
||||
}
|
||||
}
|
||||
|
||||
a.ForEachChannelMember(channel.Id, func(channelMember model.ChannelMember) error {
|
||||
cErr := a.ForEachChannelMember(channel.Id, func(channelMember model.ChannelMember) error {
|
||||
a.Srv().Store.Channel().InvalidateAllChannelMembersForUser(channelMember.UserId)
|
||||
return nil
|
||||
})
|
||||
if cErr != nil {
|
||||
return nil, model.NewAppError("PatchChannelModerationsForChannel", "api.channel.patch_channel_moderations.cache_invalidation.error", nil, cErr.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
return buildChannelModerations(channel.Type, memberRole, guestRole, higherScopedMemberRole, higherScopedGuestRole), nil
|
||||
}
|
||||
|
||||
@@ -343,6 +343,10 @@
|
||||
"id": "api.channel.move_channel.type.invalid",
|
||||
"translation": "Unable to move direct or group message channels"
|
||||
},
|
||||
{
|
||||
"id": "api.channel.patch_channel_moderations.cache_invalidation.error",
|
||||
"translation": "Error invalidating cache"
|
||||
},
|
||||
{
|
||||
"id": "api.channel.patch_channel_moderations.license.error",
|
||||
"translation": "Your license does not support channel moderation"
|
||||
|
||||
Reference in New Issue
Block a user