spring icon indicating copy to clipboard operation
spring copied to clipboard

Possible to spring rake tasks only when loading environment?

Open avit opened this issue 7 years ago • 0 comments

I'm wondering if it might be possible to use the spring preloader only when running tasks that declare an => :environment dependency.

I'm running into problems with an app that tries to establish a database connection in initializers, and fails when running rake db:setup because the preloader tries to get in front of creating the database. (Obviously one workaround is to use DISABLE_SPRING...)

I realize that some commands such as rake -T may also benefit from preloading since getting the list of engine-defined tasks depends on loading the environment...

Any thoughts on whether there's a possible approach to this? I might investigate if it makes sense.

avit avatar Oct 17 '17 23:10 avit