mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Merged in feature/PYPE-349_parallel_event_server (pull request #343)
Feature/PYPE-349 parallel event server
This commit is contained in:
commit
92ca7d9041
3 changed files with 9 additions and 9 deletions
|
|
@ -126,7 +126,7 @@ def process_event_paths(event_paths):
|
||||||
return os.pathsep.join(return_paths), not_found
|
return os.pathsep.join(return_paths), not_found
|
||||||
|
|
||||||
|
|
||||||
def old_way_server(ftrack_url):
|
def legacy_server(ftrack_url):
|
||||||
# Current file
|
# Current file
|
||||||
file_path = os.path.dirname(os.path.realpath(__file__))
|
file_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
|
||||||
|
|
@ -135,7 +135,7 @@ def old_way_server(ftrack_url):
|
||||||
wait_time_after_max_fail = 10
|
wait_time_after_max_fail = 10
|
||||||
|
|
||||||
subproc = None
|
subproc = None
|
||||||
subproc_path = "{}/sub_old_way.py".format(file_path)
|
subproc_path = "{}/sub_legacy_server.py".format(file_path)
|
||||||
subproc_last_failed = datetime.datetime.now()
|
subproc_last_failed = datetime.datetime.now()
|
||||||
subproc_failed_count = 0
|
subproc_failed_count = 0
|
||||||
|
|
||||||
|
|
@ -459,7 +459,7 @@ def main(argv):
|
||||||
action="store_true"
|
action="store_true"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-oldway',
|
'-legacy',
|
||||||
help="Load creadentials from apps dir",
|
help="Load creadentials from apps dir",
|
||||||
action="store_true"
|
action="store_true"
|
||||||
)
|
)
|
||||||
|
|
@ -487,7 +487,7 @@ def main(argv):
|
||||||
if kwargs.ftrackapikey:
|
if kwargs.ftrackapikey:
|
||||||
api_key = kwargs.ftrackapikey
|
api_key = kwargs.ftrackapikey
|
||||||
|
|
||||||
oldway = kwargs.oldway
|
legacy = kwargs.legacy
|
||||||
# Check url regex and accessibility
|
# Check url regex and accessibility
|
||||||
ftrack_url = check_ftrack_url(ftrack_url)
|
ftrack_url = check_ftrack_url(ftrack_url)
|
||||||
if not ftrack_url:
|
if not ftrack_url:
|
||||||
|
|
@ -519,8 +519,8 @@ def main(argv):
|
||||||
os.environ["FTRACK_API_KEY"] = api_key
|
os.environ["FTRACK_API_KEY"] = api_key
|
||||||
os.environ["FTRACK_EVENTS_PATH"] = event_paths
|
os.environ["FTRACK_EVENTS_PATH"] = event_paths
|
||||||
|
|
||||||
if oldway:
|
if legacy:
|
||||||
return old_way_server(ftrack_url)
|
return legacy_server(ftrack_url)
|
||||||
|
|
||||||
return main_loop(ftrack_url)
|
return main_loop(ftrack_url)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class ProcessEventHub(ftrack_api.event.hub.EventHub):
|
||||||
def prepare_dbcon(self):
|
def prepare_dbcon(self):
|
||||||
try:
|
try:
|
||||||
self.dbcon.install()
|
self.dbcon.install()
|
||||||
dbcon._database.collection_names()
|
self.dbcon._database.collection_names()
|
||||||
except pymongo.errors.AutoReconnect:
|
except pymongo.errors.AutoReconnect:
|
||||||
log.error("Mongo server \"{}\" is not responding, exiting.".format(
|
log.error("Mongo server \"{}\" is not responding, exiting.".format(
|
||||||
os.environ["AVALON_MONGO"]
|
os.environ["AVALON_MONGO"]
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ from pype.vendor import ftrack_api
|
||||||
from pype.vendor.ftrack_api.event.hub import EventHub
|
from pype.vendor.ftrack_api.event.hub import EventHub
|
||||||
from pypeapp import Logger
|
from pypeapp import Logger
|
||||||
|
|
||||||
log = Logger().get_logger("Event Server Old")
|
log = Logger().get_logger("Event Server Legacy")
|
||||||
|
|
||||||
|
|
||||||
class TimerChecker(threading.Thread):
|
class TimerChecker(threading.Thread):
|
||||||
|
|
@ -67,7 +67,7 @@ def main(args):
|
||||||
check_thread = TimerChecker(server, session)
|
check_thread = TimerChecker(server, session)
|
||||||
check_thread.start()
|
check_thread.start()
|
||||||
|
|
||||||
log.debug("Launching Ftrack Event Old Way Server")
|
log.debug("Launching Ftrack Event Legacy Server")
|
||||||
server.run_server(session)
|
server.run_server(session)
|
||||||
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue