Merge "Healthmanager health_check timer config fix"
This commit is contained in:
commit
195bfc8df5
@ -18,7 +18,7 @@ import os
|
||||
import signal
|
||||
import sys
|
||||
|
||||
from futurist.periodics import PeriodicWorker
|
||||
from futurist import periodics
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
@ -47,8 +47,15 @@ def hm_listener(exit_event):
|
||||
|
||||
def hm_health_check(exit_event):
|
||||
hm = health_manager.HealthManager(exit_event)
|
||||
health_check = PeriodicWorker([(hm.health_check, None, None)],
|
||||
schedule_strategy='aligned_last_finished')
|
||||
|
||||
@periodics.periodic(CONF.health_manager.health_check_interval,
|
||||
run_immediately=True)
|
||||
def periodic_health_check():
|
||||
hm.health_check()
|
||||
|
||||
health_check = periodics.PeriodicWorker(
|
||||
[(periodic_health_check, None, None)],
|
||||
schedule_strategy='aligned_last_finished')
|
||||
|
||||
def hm_exit(*args, **kwargs):
|
||||
health_check.stop()
|
||||
|
@ -16,7 +16,6 @@
|
||||
from concurrent import futures
|
||||
import functools
|
||||
|
||||
from futurist import periodics
|
||||
from oslo_config import cfg
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_log import log as logging
|
||||
@ -62,8 +61,6 @@ class HealthManager(object):
|
||||
self.amp_health_repo = repo.AmphoraHealthRepository()
|
||||
self.dead = exit_event
|
||||
|
||||
@periodics.periodic(CONF.health_manager.health_check_interval,
|
||||
run_immediately=True)
|
||||
def health_check(self):
|
||||
stats = {
|
||||
'failover_attempted': 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user