Skip to content

Commit

Permalink
Do not run MiqEventDefinitionSet.seed twice on start-up
Browse files Browse the repository at this point in the history
We do not need to run this twice. We have a mechanism to set
dependencies between the seeds.

On my system, running `10.times { EvmDatabase.seed_last }` gives

:sake: | rows | selects | time |  %
------ | ---- | ------- | ---- | ---
Before |    ? |       ? |  55s | 100%
After  | -130 |    -130 |  51s |  91%
  • Loading branch information
isimluk committed Apr 11, 2017
1 parent c5956c8 commit 82a3afd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion app/models/miq_event_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ def self.add_elements(_vm, xmlNode)
end

def self.seed
MiqEventDefinitionSet.seed
seed_default_events
seed_default_definitions
end
Expand Down
1 change: 1 addition & 0 deletions lib/evm_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class EvmDatabase
RssFeed
MiqWidget
MiqAction
MiqEventDefinitionSet
MiqEventDefinition
MiqPolicySet
ChargebackRateDetailMeasure
Expand Down
1 change: 1 addition & 0 deletions spec/models/authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

context "with miq events seeded" do
before(:each) do
MiqEventDefinitionSet.seed
MiqEventDefinition.seed
end

Expand Down

0 comments on commit 82a3afd

Please sign in to comment.