Skip to content

Commit

Permalink
trying to fix ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ksierks committed Oct 22, 2024
1 parent 1e78d8e commit 90dc464
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
13 changes: 13 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1

config.after_initialize do
Irida::Pipelines.instance.available_pipelines.each_value do |pipeline|
automated_workflows = AutomatedWorkflowExecution.where(
"metadata ->> 'workflow_name' = ? and metadata ->> 'workflow_version' = ?", pipeline.name, pipeline.version
)

automated_workflows.each do |automated_workflow|
automated_workflow.disabled = pipeline.executable && pipeline.automatable ? false : true
automated_workflow.save
end
end
end

# Please, add to the `ignore` list any other `lib` subdirectories that do
# not contain `.rb` files, or that should not be reloaded or eager loaded.
# Common ones are `templates`, `generators`, or `middleware`, for example.
Expand Down
11 changes: 0 additions & 11 deletions config/initializers/pipelines.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,4 @@

Rails.application.config.to_prepare do
Irida::Pipelines.instance = Irida::Pipelines.new if Irida::Pipelines.instance.nil?

Irida::Pipelines.instance.available_pipelines.each_value do |pipeline|
automated_workflows = AutomatedWorkflowExecution.where(
"metadata ->> 'workflow_name' = ? and metadata ->> 'workflow_version' = ?", pipeline.name, pipeline.version
)

automated_workflows.each do |automated_workflow|
automated_workflow.disabled = pipeline.executable && pipeline.automatable ? false : true
automated_workflow.save
end
end
end

0 comments on commit 90dc464

Please sign in to comment.