Skip to content

Commit

Permalink
Allow to create LongRunnable Agent gems
Browse files Browse the repository at this point in the history
Instead of explicitly requiring `agent_runner`, reply on the Rails
autoloader. This prevents the file being loaded twice if a Agent gem
uses `LongRunnable::Worker`.

Inheriting triggers auto loading of the `AgentRunner` class very early
in the boot process. This initializes the long runnable Agent registry
and fills the `@@agents` array with all LongRunnable agents.

When `lib/agent_runner` was then required again in `bin/pre_runner_boot.rb`,
the class is re-loaded and the long runnable Agent registry was empty.

 #2704
  • Loading branch information
dsander committed Apr 4, 2020
1 parent f3ff176 commit f89b108
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions bin/pre_runner_boot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@
Rails.configuration.cache_classes = true

Dotenv.load if ENV['APP_SECRET_TOKEN'].blank?

require 'agent_runner'

0 comments on commit f89b108

Please sign in to comment.