MM-33402: Handles cache invalidation error.

This commit is contained in:
Martin Kraft
2021-03-17 20:07:39 -04:00
parent 669e1ef2e2
commit 2d30d24658
2 changed files with 8 additions and 1 deletions
+4 -1
View File
@@ -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
}
+4
View File
@@ -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"