mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd:Ⓜ️:fetch: Simplify adherence to attempt limit option.
This commit is contained in:
parent
cb84859ccd
commit
b59e5cd166
1 changed files with 10 additions and 6 deletions
|
@ -396,19 +396,23 @@ try
|
|||
if(proffer_remote(request, request.opts.event_id.host()))
|
||||
select_remote(request, request.opts.event_id.host());
|
||||
|
||||
if(!!request.started)
|
||||
if(!request.opts.attempt_limit || request.attempted.size() < request.opts.attempt_limit)
|
||||
select_random_remote(request);
|
||||
|
||||
if(!request.started)
|
||||
request.started = ircd::now<system_point>();
|
||||
|
||||
if(!proffer_remote(request, request.origin))
|
||||
select_random_remote(request);
|
||||
|
||||
for(; request.origin; select_random_remote(request))
|
||||
while(request.origin)
|
||||
{
|
||||
if(start(request, request.origin))
|
||||
return true;
|
||||
|
||||
if(request.attempted.size() > request.opts.attempt_limit - 1UL)
|
||||
break;
|
||||
if(request.opts.attempt_limit)
|
||||
if(request.attempted.size() >= request.opts.attempt_limit)
|
||||
break;
|
||||
|
||||
select_random_remote(request);
|
||||
}
|
||||
|
||||
throw m::NOT_FOUND
|
||||
|
|
Loading…
Reference in a new issue