Merge "Make the cron trigger execution interval configurable"

This commit is contained in:
Zuul 2018-02-07 14:57:55 +00:00 committed by Gerrit Code Review
commit 7da5b880c9
2 changed files with 16 additions and 1 deletions

View File

@ -251,6 +251,20 @@ cron_trigger_opts = [
' performance.'
)
),
cfg.IntOpt(
'execution_interval',
default=1,
min=1,
help=(
'This setting defines how frequently Mistral checks for cron ',
'triggers that need execution. By default this is every second ',
'which can lead to high system load. Increasing the number will ',
'reduce the load but also limit the minimum freqency. For ',
'example, a cron trigger can be configured to run every second ',
'but if the execution_interval is set to 60, it will only run ',
'once per minute.'
)
)
]
event_engine_opts = [

View File

@ -35,7 +35,8 @@ _periodic_tasks = {}
class MistralPeriodicTasks(periodic_task.PeriodicTasks):
@periodic_task.periodic_task(spacing=1, run_immediately=True)
@periodic_task.periodic_task(spacing=CONF.cron_trigger.execution_interval,
run_immediately=True)
def process_cron_triggers_v2(self, ctx):
LOG.debug("Processing cron triggers...")