From 38926fe85e96bebde76a0dcf926e3d776c57b3a5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 8 Apr 2021 10:10:20 +0200 Subject: [PATCH] updated custom session with new timeout attribute --- openpype/modules/ftrack/ftrack_server/lib.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openpype/modules/ftrack/ftrack_server/lib.py b/openpype/modules/ftrack/ftrack_server/lib.py index 91f3712136..88f849e765 100644 --- a/openpype/modules/ftrack/ftrack_server/lib.py +++ b/openpype/modules/ftrack/ftrack_server/lib.py @@ -3,11 +3,11 @@ import sys import logging import getpass import atexit -import tempfile import threading import datetime import time import queue +import appdirs import pymongo import requests @@ -165,7 +165,6 @@ class ProcessEventHub(SocketBaseEventHub): def wait(self, duration=None): """Overriden wait - Event are loaded from Mongo DB when queue is empty. Handled event is set as processed in Mongo DB. """ @@ -252,7 +251,7 @@ class CustomEventHubSession(ftrack_api.session.Session): self, server_url=None, api_key=None, api_user=None, auto_populate=True, plugin_paths=None, cache=None, cache_key_maker=None, auto_connect_event_hub=False, schema_cache_path=None, - plugin_arguments=None, **kwargs + plugin_arguments=None, timeout=60, **kwargs ): self.kwargs = kwargs @@ -331,6 +330,7 @@ class CustomEventHubSession(ftrack_api.session.Session): self._request.auth = ftrack_api.session.SessionAuthentication( self._api_key, self._api_user ) + self.request_timeout = timeout self.auto_populate = auto_populate @@ -368,8 +368,9 @@ class CustomEventHubSession(ftrack_api.session.Session): # rebuilding types)? if schema_cache_path is not False: if schema_cache_path is None: + schema_cache_path = appdirs.user_cache_dir() schema_cache_path = os.environ.get( - 'FTRACK_API_SCHEMA_CACHE_PATH', tempfile.gettempdir() + 'FTRACK_API_SCHEMA_CACHE_PATH', schema_cache_path ) schema_cache_path = os.path.join(