mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Check for agent class file to determine if it's valid (#1907)
The previous approach of checking if the class is defined caused problems when the agent class had not yet been loaded by the process. Using Agent.valid_type? instead seems to be the approach that is taken elsewhere in the codebase, and it does not suffer from this problem.
This commit is contained in:
parent
11b6a2c459
commit
3dda1ffb63
1 changed files with 1 additions and 1 deletions
|
@ -418,7 +418,7 @@ class Agent < ActiveRecord::Base
|
|||
return if schedule == 'never'
|
||||
types = where(:schedule => schedule).group(:type).pluck(:type)
|
||||
types.each do |type|
|
||||
next unless const_defined?(type)
|
||||
next unless valid_type?(type)
|
||||
type.constantize.bulk_check(schedule)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue