I'm trying to run a method immediately on startup in my rails project. Previously I used the following for running locally
# application.rb
if defined?(Rails::Server)
config.after_initialize do
# Do stuff here
end
end
While this works locally, we are now running on prod with bundle exec rackup
, which returns false for the above statement. Is there something I can call in my Rails project to execute a method immediately on start from Rackup?