Skip to content

Commit

Permalink
Use suggested base class cache clearing method
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed Feb 23, 2023
1 parent 2c3cfbc commit f697491
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/event_stream.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.class_group_levels
end

def self.clear_event_groups_cache
# subclasses can implement their own cache clearing
descendants.each { |c| c.clear_event_groups_cache if c.respond_to?(:clear_event_groups_cache) }
end

def self.group_levels
Expand Down
3 changes: 1 addition & 2 deletions spec/support/evm_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def self.clear_caches
clear_instance_variable(MiqWorker, :@rails_worker) if defined?(MiqWorker)
clear_instance_variable(Tenant, :@root_tenant) if defined?(Tenant)

EmsEvent.clear_event_groups_cache if defined?(EmsEvent)
MiqEvent.clear_event_groups_cache if defined?(MiqEvent)
EventStream.clear_event_groups_cache if defined?(EventStream)

MiqWorker.my_guid = nil

Expand Down

0 comments on commit f697491

Please sign in to comment.