From 0c7ddbdb4f7dbd46f1dadc3242dbb13b81b47758 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 20 Jul 2026 19:49:34 -0400 Subject: [PATCH] refac --- backend/open_webui/utils/auth.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/utils/auth.py b/backend/open_webui/utils/auth.py index c95e23bb85..c8ff94bc09 100644 --- a/backend/open_webui/utils/auth.py +++ b/backend/open_webui/utils/auth.py @@ -96,11 +96,15 @@ def get_license_data(app, key): setattr(app.state, 'LICENSE_METADATA', v) def handler(u): - res = requests.post( - f'{u}/api/v1/license/', - json={'key': key, 'version': '1'}, - timeout=5, - ) + try: + res = requests.post( + f'{u}/api/v1/license/', + json={'key': key, 'version': '1'}, + timeout=5, + ) + except Exception as ex: + log.error(f'License: retrieval issue from {u}: {ex}') + return False if getattr(res, 'ok', False): payload = getattr(res, 'json', lambda: {})()