Always clear channel cache when scheme is deleted (#14989)

This commit is contained in:
Farhan Munshi
2020-07-10 00:09:00 -04:00
committed by GitHub
parent 3c2b1571f4
commit da95d40e33

View File

@@ -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 {
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.
roleNames := []string{scheme.DefaultChannelGuestRole, scheme.DefaultChannelUserRole, scheme.DefaultChannelAdminRole}
if scheme.Scope == model.SCHEME_SCOPE_TEAM {