Better organize the source file structure of the build manager and change it to choose a lifecycle manager based on the config

This commit is contained in:
Joseph Schorr 2014-11-25 16:14:44 -05:00
parent c48559ee3d
commit 660a640de6
12 changed files with 34 additions and 20 deletions

View file

@ -11,7 +11,7 @@ from threading import Event
from trollius.coroutines import From
from datetime import datetime, timedelta
from buildman.buildjob import BuildJob, BuildJobLoadException
from buildman.jobutil.buildjob import BuildJob, BuildJobLoadException
from data.queue import WorkQueue
LOGGER = logging.getLogger(__name__)
@ -21,6 +21,9 @@ TIMEOUT_PERIOD_MINUTES = 20
JOB_TIMEOUT_SECONDS = 300
MINIMUM_JOB_EXTENSION = timedelta(minutes=2)
WEBSOCKET_PORT = 8080
CONTROLLER_PORT = 8181
class BuildJobResult(object):
""" Build job result enum """
INCOMPLETE = 'incomplete'
@ -166,8 +169,8 @@ class BuilderServer(object):
transport_factory.setProtocolOptions(failByDrop=True)
# Initialize the controller server and the WAMP server
create_wsgi_server(self._controller_app, loop=loop, host=host, port=8181)
yield From(loop.create_server(transport_factory, host, 8080))
create_wsgi_server(self._controller_app, loop=loop, host=host, port=CONTROLLER_PORT)
yield From(loop.create_server(transport_factory, host, WEBSOCKET_PORT))
# Initialize the work queue checker.
yield From(self._work_checker())