cbrain
cbrain copied to clipboard
Improve Ruby search path scanning at boot time
When a CBRAIN install has lots of plugins, the search path for Ruby code can get quite big, instead of being constant. This is because we add on path per userfile file type, as seen in config/application.rb
:
# CBRAIN Plugins load paths: add directories for each Userfile model
config.eager_load_paths += Dir[ * Dir.glob("#{config.root}/cbrain_plugins/installed-plugins/userfiles/*") ]
One reason is that each directory there contains more than just a ruby model, it might contain views and other local support code.
We need to find a way to join all of this together in some sort of single structure, maybe by creating better symlinks in the installed-plugins
subtree. We'd need to enhance the rake task cbrain:plugins:install:all
This is normally not much of a problem, except on VERY VERY slow filesystems, where at boot time the scanning of each directory to find each model file can make the entrire process excruciating. Do we even need to improve this, if the fault is really outside of CBRAIN?
I'm raising the priority of this a little now.