Skip to content

Commit f976ea6

Browse files
vinistockandyw8
andcommitted
Do not reload rake tasks when under add-on environment
Co-authored-by: Andy Waite <[email protected]>
1 parent 7e68f5c commit f976ea6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/tapioca/dsl/pipeline.rb

+5
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,14 @@ def report_error(error)
225225

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

230234
Rails.application.load_tasks
235+
231236
if Rake::Task.task_defined?("db:abort_if_pending_migrations")
232237
Rake::Task["db:abort_if_pending_migrations"].invoke
233238
end

0 commit comments

Comments
 (0)