diff --git a/project/base_settings/restclients_settings.py b/project/base_settings/restclients_settings.py index 5edc3dc..8a72c41 100644 --- a/project/base_settings/restclients_settings.py +++ b/project/base_settings/restclients_settings.py @@ -5,12 +5,15 @@ APPLICATION_KEY_PATH = os.getenv('KEY_PATH', '') RESTCLIENTS_CA_BUNDLE = '/app/certs/ca-bundle.crt' RESTCLIENTS_DAO_CACHE_CLASS = os.getenv('CACHE_CLASS', '') -RESTCLIENTS_DEFAULT_TIMEOUT = 2 +RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT = 3 +RESTCLIENTS_DEFAULT_TIMEOUT = 10 RESTCLIENTS_DEFAULT_POOL_SIZE = 10 RESTCLIENTS_DEFAULT_ENVS = ['PROD', 'EVAL'] if os.getenv('GWS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_GWS_DAO_CLASS = 'Live' + RESTCLIENTS_GWS_CONNECT_TIMEOUT = os.getenv( + "GWS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_GWS_TIMEOUT = os.getenv( "GWS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_GWS_POOL_SIZE = os.getenv( @@ -24,6 +27,8 @@ if os.getenv('SWS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_SWS_DAO_CLASS = 'Live' + RESTCLIENTS_SWS_CONNECT_TIMEOUT = os.getenv( + "SWS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_SWS_TIMEOUT = os.getenv( "SWS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_SWS_POOL_SIZE = os.getenv( @@ -37,6 +42,8 @@ if os.getenv('PWS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_PWS_DAO_CLASS = 'Live' + RESTCLIENTS_PWS_CONNECT_TIMEOUT = os.getenv( + "PWS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_PWS_TIMEOUT = os.getenv( "PWS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_PWS_POOL_SIZE = os.getenv( @@ -50,6 +57,8 @@ if os.getenv('KWS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_KWS_DAO_CLASS = 'Live' + RESTCLIENTS_KWS_CONNECT_TIMEOUT = os.getenv( + "KWS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_KWS_TIMEOUT = os.getenv( "KWS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_KWS_POOL_SIZE = os.getenv( @@ -63,6 +72,8 @@ if os.getenv('HRPWS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_HRPWS_DAO_CLASS = 'Live' + RESTCLIENTS_HRPWS_CONNECT_TIMEOUT = os.getenv( + "HRPWS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_HRPWS_TIMEOUT = os.getenv( "HRPWS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_HRPWS_POOL_SIZE = os.getenv( @@ -76,6 +87,8 @@ if os.getenv('NWS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_NWS_DAO_CLASS = 'Live' + RESTCLIENTS_NWS_CONNECT_TIMEOUT = os.getenv( + "NWS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_NWS_TIMEOUT = os.getenv( "NWS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_NWS_POOL_SIZE = os.getenv( @@ -93,6 +106,8 @@ if os.getenv('UWNETID_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_UWNETID_DAO_CLASS = 'Live' + RESTCLIENTS_UWNETID_CONNECT_TIMEOUT = os.getenv( + "UWNETID_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_UWNETID_TIMEOUT = os.getenv( "UWNETID_TIMEOUT", 55) RESTCLIENTS_UWNETID_POOL_SIZE = os.getenv( @@ -105,6 +120,8 @@ if os.getenv('CANVAS_ENV') in ['PROD', 'EVAL', 'BETA']: RESTCLIENTS_CANVAS_DAO_CLASS = 'Live' + RESTCLIENTS_CANVAS_CONNECT_TIMEOUT = os.getenv( + "CANVAS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_CANVAS_TIMEOUT = os.getenv( "CANVAS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_CANVAS_POOL_SIZE = os.getenv( @@ -120,6 +137,8 @@ if os.getenv('CODA_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_CODA_DAO_CLASS = 'Live' + RESTCLIENTS_CODA_CONNECT_TIMEOUT = os.getenv( + "CODA_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_CODA_TIMEOUT = os.getenv( "CODA_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_CODA_POOL_SIZE = os.getenv( @@ -132,6 +151,8 @@ if os.getenv('CATALYST_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_CATALYST_DAO_CLASS = 'Live' + RESTCLIENTS_CATALYST_CONNECT_TIMEOUT = os.getenv( + "CATALYST_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_CATALYST_TIMEOUT = os.getenv( "CATALYST_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_CATALYST_POOL_SIZE = os.getenv( @@ -149,6 +170,8 @@ if os.getenv('GRADEPAGE_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_GRADEPAGE_DAO_CLASS = 'Live' + RESTCLIENTS_GRADEPAG_CONNECT_TIMEOUT = os.getenv( + "GRADEPAG_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_GRADEPAGE_DAO_CLASS_TIMEOUT = os.getenv( "GRADEPAGE_DAO_CLASS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_GRADEPAGE_DAO_CLASS_POOL_SIZE = os.getenv( @@ -160,6 +183,8 @@ if os.getenv('BOOKSTORE_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_BOOK_DAO_CLASS = 'Live' + RESTCLIENTS_BOOK_CONNECT_TIMEOUT = os.getenv( + "BOOK_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_BOOK_TIMEOUT = os.getenv( "BOOK_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_BOOK_POOL_SIZE = os.getenv( @@ -168,6 +193,8 @@ if os.getenv('GRAD_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_GRAD_DAO_CLASS = 'Live' + RESTCLIENTS_GRAD_CONNECT_TIMEOUT = os.getenv( + "GRAD_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_GRAD_CERT_FILE = APPLICATION_CERT_PATH RESTCLIENTS_GRAD_KEY_FILE = APPLICATION_KEY_PATH if os.getenv('GRAD_ENV') == 'PROD': @@ -177,6 +204,8 @@ if os.getenv('MYPLAN_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_MYPLAN_DAO_CLASS = 'Live' + RESTCLIENTS_MYPLAN_CONNECT_TIMEOUT = os.getenv( + "MYPLAN_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_MYPLAN_TIMEOUT = os.getenv( "MYPLAN_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_MYPLAN_POOL_SIZE = os.getenv( @@ -190,6 +219,8 @@ if os.getenv('LIBCURRICS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_LIBCURRICS_DAO_CLASS = 'Live' + RESTCLIENTS_LIBCURRICS_CONNECT_TIMEOUT = os.getenv( + "LIBCURRICS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_LIBCURRICS_TIMEOUT = os.getenv( "LIBCURRICS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_LIBCURRICS_POOL_SIZE = os.getenv( @@ -200,6 +231,8 @@ if os.getenv('LIBRARIES_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_LIBRARIES_DAO_CLASS = 'Live' + RESTCLIENTS_LIBRARIES_CONNECT_TIMEOUT = os.getenv( + "LIBRARIES_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_LIBRARIES_TIMEOUT = os.getenv( "LIBRARIES_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_LIBRARIES_POOL_SIZE = os.getenv( @@ -210,6 +243,8 @@ if os.getenv('CALENDAR_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_CALENDAR_DAO_CLASS = 'Live' + RESTCLIENTS_CALENDAR_CONNECT_TIMEOUT = os.getenv( + "CALENDAR_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_CALENDAR_TIMEOUT = os.getenv( "CALENDAR_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_CALENDAR_POOL_SIZE = os.getenv( @@ -220,6 +255,8 @@ if os.getenv('SDBMYUW_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_SDBMYUW_DAO_CLASS = 'Live' + RESTCLIENTS_SDBMYUW_CONNECT_TIMEOUT = os.getenv( + "SDBMYUW_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_SDBMYUW_TIMEOUT = os.getenv( "SDBMYUW_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_SDBMYUW_POOL_SIZE = os.getenv( @@ -231,6 +268,8 @@ if os.getenv('HFS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_HFS_DAO_CLASS = 'Live' + RESTCLIENTS_HFS_CONNECT_TIMEOUT = os.getenv( + "HFS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_HFS_TIMEOUT = os.getenv( "HFS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_HFS_POOL_SIZE = os.getenv( @@ -244,6 +283,8 @@ if os.getenv('UWIDP_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_UWIDP_DAO_CLASS = 'Live' + RESTCLIENTS_UWID_CONNECT_TIMEOUT = os.getenv( + "UWID_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_UWIDP_TIMEOUT = os.getenv( "UWIDP_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_UWIDP_POOL_SIZE = os.getenv( @@ -255,6 +296,8 @@ if os.getenv('ADSEL_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_ADSEL_DAO_CLASS = 'Live' + RESTCLIENTS_ADSEL_CONNECT_TIMEOUT = os.getenv( + "ADSEL_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_ADSEL_TIMEOUT = os.getenv( "ADSEL_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_ADSEL_POOL_SIZE = os.getenv( @@ -268,6 +311,8 @@ if os.getenv('UPASS_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_UPASS_DAO_CLASS = 'Live' + RESTCLIENTS_UPASS_CONNECT_TIMEOUT = os.getenv( + "UPASS_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_UPASS_TIMEOUT = os.getenv( "UPASS_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_UPASS_POOL_SIZE = os.getenv( @@ -281,6 +326,8 @@ if os.getenv('IASYSTEM_UW_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_IASYSTEM_UW_DAO_CLASS = 'Live' + RESTCLIENTS_IASYSTEM_UW_CONNECT_TIMEOUT = os.getenv( + "IASYSTEM_UW_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_IASYSTEM_UW_TIMEOUT = os.getenv( "IASYSTEM_UW_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_IASYSTEM_UW_POOL_SIZE = os.getenv( @@ -291,6 +338,9 @@ if os.getenv('IASYSTEM_UWB_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_IASYSTEM_UWB_DAO_CLASS = 'Live' + RESTCLIENTS_IASYSTEM_UWB_CONNECT_TIMEOUT = os.getenv( + "IASYSTEM_UWB_CONNECT_TIMEOUT", + RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_IASYSTEM_UWB_TIMEOUT = os.getenv( "IASYSTEM_UWB_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_IASYSTEM_UWB_POOL_SIZE = os.getenv( @@ -301,6 +351,9 @@ if os.getenv('IASYSTEM_UWT_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_IASYSTEM_UWT_DAO_CLASS = 'Live' + RESTCLIENTS_IASYSTEM_UWT_CONNECT_TIMEOUT = os.getenv( + "IASYSTEM_UWT_CONNECT_TIMEOUT", + RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_IASYSTEM_UWT_TIMEOUT = os.getenv( "IASYSTEM_UWT_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_IASYSTEM_UWT_POOL_SIZE = os.getenv( @@ -311,6 +364,9 @@ if os.getenv('IASYSTEM_UWEO_AP_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_IASYSTEM_UWEO_AP_DAO_CLASS = 'Live' + RESTCLIENTS_IASYSTEM_UWEO_AP_CONNECT_TIMEOUT = os.getenv( + "IASYSTEM_UWEO_AP_CONNECT_TIMEOUT", + RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_UWEO_AP_TIMEOUT = os.getenv( "UWEO_AP_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_UWEO_AP_POOL_SIZE = os.getenv( @@ -321,6 +377,9 @@ if os.getenv('IASYSTEM_UWEO_IELP_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_IASYSTEM_UWEO_IELP_DAO_CLASS = 'Live' + RESTCLIENTS_IASYSTEM_UWEO_IELP_CONNECT_TIMEOUT = os.getenv( + "IASYSTEM_UWEO_IELP_CONNECT_TIMEOUT", + RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_IASYSTEM_UWEO_IELP_TIMEOUT = os.getenv( "IASYSTEM_UWEO_IELP_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_IASYSTEM_UWEO_IELP_POOL_SIZE = os.getenv( @@ -330,6 +389,8 @@ RESTCLIENTS_IASYSTEM_UWEO_IELP_HOST = 'https://uweo-ielp.iasystem.org' if os.getenv('ASTRA_ENV') in RESTCLIENTS_DEFAULT_ENVS: + RESTCLIENTS_ASTRA_CONNECT_TIMEOUT = os.getenv( + "ASTRA_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_ASTRA_TIMEOUT = os.getenv( "ASTRA_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_ASTRA_POOL_SIZE = os.getenv( @@ -345,6 +406,8 @@ if os.getenv('R25_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_R25_DAO_CLASS = 'Live' + RESTCLIENTS_R25_CONNECT_TIMEOUT = os.getenv( + "R25_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_R25_TIMEOUT = os.getenv( "R25_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_R25_POOL_SIZE = os.getenv( @@ -356,6 +419,8 @@ if os.getenv('MAILMAN_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_MAILMAN_DAO_CLASS = 'Live' + RESTCLIENTS_MAILMAN_CONNECT_TIMEOUT = os.getenv( + "MAILMAN_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_MAILMAN_TIMEOUT = os.getenv( "MAILMAN_TIMEOUT", RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_MAILMAN_POOL_SIZE = os.getenv( @@ -367,6 +432,8 @@ if os.getenv('TRUMBA_SEA_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_TRUMBA_SEA_DAO_CLASS = 'Live' + RESTCLIENTS_TRUMBA_SEA_CONNECT_TIMEOUT = os.getenv( + "TRUMBA_SEA_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_TRUMBA_SEA_TIMEOUT = os.getenv( 'TRUMBA_SEA_TIMEOUT', RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_TRUMBA_SEA_POOL_SIZE = os.getenv( @@ -379,6 +446,8 @@ if os.getenv('TRUMBA_BOT_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_TRUMBA_BOT_DAO_CLASS = 'Live' + RESTCLIENTS_TRUMBA_BOT_CONNECT_TIMEOUT = os.getenv( + "TRUMBA_BOT_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_TRUMBA_BOT_TIMEOUT = os.getenv( 'TRUMBA_BOT_TIMEOUT', RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_TRUMBA_BOT_POOL_SIZE = os.getenv( @@ -391,6 +460,8 @@ if os.getenv('TRUMBA_TAC_ENV') in RESTCLIENTS_DEFAULT_ENVS: RESTCLIENTS_TRUMBA_TAC_DAO_CLASS = 'Live' + RESTCLIENTS_TRUMBA_TAC_CONNECT_TIMEOUT = os.getenv( + "TRUMBA_TAC_CONNECT_TIMEOUT", RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT) RESTCLIENTS_TRUMBA_TAC_TIMEOUT = os.getenv( 'TRUMBA_TAC_TIMEOUT', RESTCLIENTS_DEFAULT_TIMEOUT) RESTCLIENTS_TRUMBA_TAC_POOL_SIZE = os.getenv(