This commit is contained in:
@@ -179,7 +179,9 @@ def load_categories():
|
||||
# Добавляем таймаут для избежания зависаний (30 секунд)
|
||||
from urllib.request import Request
|
||||
req = Request(desc_url)
|
||||
safe_log_direct("run urlopen", "DEBUG")
|
||||
response = urlopen(req, timeout=30)
|
||||
safe_log_direct("done urlopen", "ERROR")
|
||||
log_message("urlopen успешно выполнен")
|
||||
except (URLError, HTTPError, OSError, socket.gaierror, socket.timeout, ConnectionError) as e:
|
||||
# Используем безопасное логирование для критических ошибок
|
||||
|
||||
Reference in New Issue
Block a user