Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customized tornado_settings (issue #22) #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions ndscheduler/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,18 @@ class SchedulerServer:

singleton = None

def __init__(self, scheduler_instance):
# Start scheduler
def __init__(self, scheduler_instance, custom_tornado_settings=None):
"""
Start scheduler

Pass:
scheduler_instance - instance of the `SchedulerManager` class
custom_tornado_settings - optional dictionary of settings, to
be merged if present with the defaults
set below, adding to and/or replacing
the settings in `self.tornado_settings`
"""

self.scheduler_manager = scheduler_instance

self.tornado_settings = dict(
Expand All @@ -37,6 +47,8 @@ def __init__(self, scheduler_instance):
template_path=settings.TEMPLATE_DIR_PATH,
scheduler_manager=self.scheduler_manager
)
if custom_tornado_settings is not None:
self.tornado_settings.update(custom_tornado_settings)

# Setup server
URLS = [
Expand Down