Fix to reuse RabbitMQ connection

Currently RabbitMQ connection gradually increases by CONTINUOUS audit
with auto-trigger option.
This patch fixes watcher to reuse RabbitMQ connection.

Change-Id: I818fc1ce982f67bac08c815821f1ad67f8f3c893
This commit is contained in:
Hidekazu Nakamura
2018-05-10 14:21:23 +09:00
parent 6efffd6d89
commit cdb1975530
3 changed files with 10 additions and 11 deletions

View File

@@ -63,6 +63,7 @@ class AuditHandler(BaseAuditHandler):
self._strategy_context = default_context.DefaultStrategyContext()
self._planner_manager = planner_manager.PlannerManager()
self._planner = None
self.applier_client = rpcapi.ApplierAPI()
@property
def planner(self):
@@ -125,9 +126,8 @@ class AuditHandler(BaseAuditHandler):
def post_execute(self, audit, solution, request_context):
action_plan = self.do_schedule(request_context, audit, solution)
if audit.auto_trigger:
applier_client = rpcapi.ApplierAPI()
applier_client.launch_action_plan(request_context,
action_plan.uuid)
self.applier_client.launch_action_plan(request_context,
action_plan.uuid)
def execute(self, audit, request_context):
try: