Enhance proxy handling and error reporting in collection process
- Introduced a `Via` field in `ParseError` to indicate the proxy address used during requests, improving clarity on error contexts. - Updated `ProxyPool` to prioritize confirmed live proxies while available, ensuring more reliable proxy selection and reducing connection timeouts. - Implemented fallback logic to allow the use of unconfirmed proxies when no confirmed ones are available, preventing collection stalls. - Adjusted logging in `CollectLogEntryViewModel` to include proxy details, enhancing error visibility for users. - Added unit tests to verify new proxy selection logic and ensure correct behavior under various conditions. These changes improve the robustness of the proxy management system and enhance the overall user experience by providing clearer error messages and more efficient proxy usage.
This commit is contained in:
@@ -56,6 +56,9 @@
|
||||
`ConcurrentQueue`, слив под `_flushGate`, иначе две гонки-выгрузки перемешают строки местами.
|
||||
- **Строка хранит ключ и аргументы, а не готовое предложение** — смена языка посреди прогона иначе
|
||||
оставит половину журнала по-английски. Литеральная половина (адрес, размер) не переводится никогда.
|
||||
- **Прокси попытки живёт в `ParseError.Via`** и печатается в строке как `via {адрес}`: «сайт ответил
|
||||
404» через подтверждённую прокси и через ту, с которой никто не разговаривал, — разные диагнозы, а
|
||||
без этого поля разница невидима.
|
||||
- **Адрес неудачи живёт в `ParseError.Subject`.** В `Message` его нет и быть не может: у шаблона
|
||||
перевода фиксированные подстановки. Без него журнал говорит «сайт ответил 404» и не говорит, на
|
||||
каком из десяти тысяч id.
|
||||
|
||||
Reference in New Issue
Block a user