Skip to content

Commit

Permalink
Merge pull request #2061 from Shopify/vs-do-not-reload-rake-tasks
Browse files Browse the repository at this point in the history
Do not reload rake tasks when under add-on environment
  • Loading branch information
vinistock authored Nov 4, 2024
2 parents 7e68f5c + f976ea6 commit cc19ba0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/tapioca/dsl/pipeline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,14 @@ def report_error(error)

sig { void }
def abort_if_pending_migrations!
# When running within the add-on, we cannot invoke the abort if pending migrations task because that will exit
# the process and crash the Rails runtime server. Instead, the Rails add-on checks for pending migrations and
# warns the user, so that they are aware they need to migrate their database
return if @lsp_addon
return unless defined?(::Rake)

Rails.application.load_tasks

if Rake::Task.task_defined?("db:abort_if_pending_migrations")
Rake::Task["db:abort_if_pending_migrations"].invoke
end
Expand Down

0 comments on commit cc19ba0

Please sign in to comment.