Refactor and add a check around a variable
Changed serializer to self._serializer, to be able to access it from other places in the engine class. Added a check to make sure it doesn't get created twice. Change-Id: Ia4007a5f98af04677b2006a88b66cbf8ceec2982
This commit is contained in:
parent
f3c51ab67d
commit
1a860ac47b
|
@ -77,6 +77,9 @@ class Engine(object):
|
|||
# Watchdog-related variables
|
||||
self._watchdog_thread = None
|
||||
|
||||
# Serializer related variables
|
||||
self._serializer = None
|
||||
|
||||
LOG.info('Created engine obj %s', self.name)
|
||||
|
||||
# TODO(praneshp): Move to utils?
|
||||
|
@ -106,8 +109,9 @@ class Engine(object):
|
|||
self.start_scheduler()
|
||||
|
||||
def start_scheduler(self):
|
||||
serializer = self.executor.submit(self.start_serializer)
|
||||
self.futures.append(serializer)
|
||||
if not self._serializer:
|
||||
self._serializer = self.executor.submit(self.start_serializer)
|
||||
self.futures.append(self._serializer)
|
||||
|
||||
# Start react scripts.
|
||||
self.futures.extend(self.start_react_scripts())
|
||||
|
|
Loading…
Reference in New Issue