Skip to content

Commit

Permalink
Merge pull request #732 from lanl/issue-741/query-updates
Browse files Browse the repository at this point in the history
Make task manager background time interval configurable
  • Loading branch information
pagrubel authored Oct 26, 2023
2 parents ff60683 + cf99498 commit 22f736f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions beeflow/common/config_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ def filepath_completion_input(*pargs, **kwargs):
info='container runtime to use for configuration')
VALIDATOR.option('task_manager', 'runner_opts', attrs={'default': ''},
info='special runner options to pass to the runner opts')
VALIDATOR.option('task_manager', 'background_interval', attrs={'default': 10},
validator=int,
info='interval at which the task manager processes queues and updates states')

# Note: The special attrs keyword can include anything. One use case is for
# storing a special 'init' function that can be used to initialize the
Expand Down
3 changes: 2 additions & 1 deletion beeflow/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def process_queues():

if "pytest" not in sys.modules:
scheduler = BackgroundScheduler({'apscheduler.timezone': 'UTC'})
scheduler.add_job(func=process_queues, trigger="interval", seconds=30)
scheduler.add_job(func=process_queues, trigger="interval",
seconds=bc.get('task_manager', 'background_interval'))
scheduler.start()

# This kills the scheduler when the process terminates
Expand Down
1 change: 1 addition & 0 deletions ci/bee_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ max_restarts = 2
[task_manager]
container_runtime = Charliecloud
runner_opts =
background_interval = 2
[charliecloud]
image_mntdir = /tmp
Expand Down

0 comments on commit 22f736f

Please sign in to comment.