mirror of
https://github.com/lampame/lampac-ukraine.git
synced 2026-04-16 17:32:20 +00:00
refactor: extract and validate HTTP timeout, ensuring a positive default value.
This commit is contained in:
parent
208aad107e
commit
8c576249b3
@ -95,9 +95,13 @@ namespace JackTor
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
_onLog?.Invoke($"JackTor: запит до Jackett -> {query}");
|
_onLog?.Invoke($"JackTor: запит до Jackett -> {query}");
|
||||||
|
int timeoutSeconds = Convert.ToInt32(_init.httptimeout);
|
||||||
|
if (timeoutSeconds <= 0)
|
||||||
|
timeoutSeconds = 12;
|
||||||
|
|
||||||
var root = await Http.Get<JackettSearchRoot>(
|
var root = await Http.Get<JackettSearchRoot>(
|
||||||
_init.cors(url),
|
_init.cors(url),
|
||||||
timeoutSeconds: _init.httptimeout > 0 ? _init.httptimeout : 12,
|
timeoutSeconds: timeoutSeconds,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
proxy: _proxyManager.Get()
|
proxy: _proxyManager.Get()
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user