mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added error logs
This commit is contained in:
parent
aad641f233
commit
ee8f09cf46
3 changed files with 16 additions and 1 deletions
|
|
@ -17,6 +17,9 @@ import ftrack_api.event
|
|||
from ftrack_api.logging import LazyLogMessage as L
|
||||
|
||||
from pype.ftrack.lib.custom_db_connector import DbConnector
|
||||
from pypeapp import Logger
|
||||
|
||||
log = Logger().get_logger("Session processor")
|
||||
|
||||
|
||||
class ProcessEventHub(ftrack_api.event.hub.EventHub):
|
||||
|
|
@ -39,6 +42,9 @@ class ProcessEventHub(ftrack_api.event.hub.EventHub):
|
|||
self.dbcon.active_table = self.table_name
|
||||
self.is_table_created = True
|
||||
except pymongo.errors.AutoReconnect:
|
||||
log.error("Mongo server \"{}\" is not responding, exiting.".format(
|
||||
os.environ["AVALON_MONGO"]
|
||||
))
|
||||
sys.exit(0)
|
||||
|
||||
def wait(self, duration=None):
|
||||
|
|
@ -65,6 +71,9 @@ class ProcessEventHub(ftrack_api.event.hub.EventHub):
|
|||
{"$set": {"pype_data.is_processed": True}}
|
||||
)
|
||||
except pymongo.errors.AutoReconnect:
|
||||
log.error((
|
||||
"Mongo server \"{}\" is not responding, exiting."
|
||||
).format(os.environ["AVALON_MONGO"]))
|
||||
sys.exit(0)
|
||||
# Additional special processing of events.
|
||||
if event['topic'] == 'ftrack.meta.disconnected':
|
||||
|
|
|
|||
|
|
@ -44,4 +44,4 @@ if __name__ == "__main__":
|
|||
signal.signal(signal.SIGINT, signal_handler)
|
||||
signal.signal(signal.SIGTERM, signal_handler)
|
||||
|
||||
main(sys.argv)
|
||||
return main(sys.argv)
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ def install_db():
|
|||
dbcon.create_table(table_name, capped=False)
|
||||
dbcon.active_table = table_name
|
||||
except pymongo.errors.AutoReconnect:
|
||||
log.error("Mongo server \"{}\" is not responding, exiting.".format(
|
||||
os.environ["AVALON_MONGO"]
|
||||
))
|
||||
sys.exit(0)
|
||||
|
||||
def launch(event):
|
||||
|
|
@ -48,6 +51,9 @@ def launch(event):
|
|||
log.debug("Event: {} stored".format(event_id))
|
||||
|
||||
except pymongo.errors.AutoReconnect:
|
||||
log.error("Mongo server \"{}\" is not responding, exiting.".format(
|
||||
os.environ["AVALON_MONGO"]
|
||||
))
|
||||
sys.exit(0)
|
||||
|
||||
except Exception as exc:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue