Always clear channel cache when scheme is deleted (#14989)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3c2b1571f4
Коммит
da95d40e33
@@ -287,11 +287,11 @@ func (s *SqlSchemeStore) Delete(schemeId string) (*model.Scheme, error) {
|
|||||||
if _, err := s.GetMaster().Exec("UPDATE Channels SET SchemeId = '' WHERE SchemeId = :SchemeId", map[string]interface{}{"SchemeId": schemeId}); err != nil {
|
if _, err := s.GetMaster().Exec("UPDATE Channels SET SchemeId = '' WHERE SchemeId = :SchemeId", map[string]interface{}{"SchemeId": schemeId}); err != nil {
|
||||||
return nil, errors.Wrapf(err, "failed to update Channels with schemeId=%s", schemeId)
|
return nil, errors.Wrapf(err, "failed to update Channels with schemeId=%s", schemeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Blow away the channel caches.
|
|
||||||
s.Channel().ClearCaches()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Blow away the channel caches.
|
||||||
|
s.Channel().ClearCaches()
|
||||||
|
|
||||||
// Delete the roles belonging to the scheme.
|
// Delete the roles belonging to the scheme.
|
||||||
roleNames := []string{scheme.DefaultChannelGuestRole, scheme.DefaultChannelUserRole, scheme.DefaultChannelAdminRole}
|
roleNames := []string{scheme.DefaultChannelGuestRole, scheme.DefaultChannelUserRole, scheme.DefaultChannelAdminRole}
|
||||||
if scheme.Scope == model.SCHEME_SCOPE_TEAM {
|
if scheme.Scope == model.SCHEME_SCOPE_TEAM {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user