lib/contrast/utils/job_servers_running.rb in contrast-agent-4.6.0 vs lib/contrast/utils/job_servers_running.rb in contrast-agent-4.7.0
- old
+ new
@@ -22,15 +22,20 @@
logger.trace('Detected the spawn of a Sidekiq process')
true
end
def rake_running?
- return unless defined?(Rake) &&
- Rake.cs__respond_to?(:application) &&
- Rake.application.cs__respond_to?(:top_level_tasks)
+ unless defined?(Rake) &&
+ Rake.cs__respond_to?(:application) &&
+ Rake.application.cs__respond_to?(:top_level_tasks)
+ return
+ end
+
disabled_rake_tasks = APP_CONTEXT.disabled_agent_rake_tasks
- has_disabled_task = Rake.application.top_level_tasks.any? { |top_level_task| disabled_rake_tasks.include?(top_level_task) }
+ has_disabled_task = Rake.application.top_level_tasks.any? do |top_level_task|
+ disabled_rake_tasks.include?(top_level_task)
+ end
return false unless has_disabled_task
logger.trace('Detected startup within Rake task')
true
end