mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
do not call agent.converge_state_and_update before agent.execute
This commit is contained in:
parent
c2e4e4f185
commit
40a807d4e6
2 changed files with 14 additions and 2 deletions
|
@ -162,6 +162,18 @@ class LogStash::Agent
|
|||
@running.false?
|
||||
end
|
||||
|
||||
# Only call converge_state_and_update if agent is running
|
||||
# to avoid a double call to converge_state_and_update since
|
||||
# agent.execute will call converge_state_and_update itself
|
||||
def converge_state_and_update_if_running
|
||||
converge_state_and_update if running?
|
||||
end
|
||||
|
||||
# Trigger convergence of pipelines
|
||||
# NOTE that there is no point of calling this method before
|
||||
# Agent#execute has been called since it will itself call
|
||||
# converge_state_and_update and will result in a double
|
||||
# convergence.
|
||||
def converge_state_and_update
|
||||
results = @source_loader.fetch
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ module LogStash module Monitoring
|
|||
super(xpack_info) if xpack_info
|
||||
if valid_basic_license?
|
||||
logger.info("Validated license for monitoring. Enabling monitoring pipeline.")
|
||||
enable_monitoring()
|
||||
enable_monitoring
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -45,7 +45,7 @@ module LogStash module Monitoring
|
|||
end
|
||||
|
||||
def enable_monitoring
|
||||
@agent.converge_state_and_update
|
||||
@agent.converge_state_and_update_if_running
|
||||
end
|
||||
|
||||
def populate_license_state(xpack_info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue