mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
modules/s_fetch: Report nr of reaped requests.
This commit is contained in:
parent
12109be1a7
commit
1063fcb657
2 changed files with 12 additions and 5 deletions
|
@ -587,7 +587,9 @@ try
|
|||
});
|
||||
});
|
||||
|
||||
request_cleanup();
|
||||
if(request_cleanup())
|
||||
continue;
|
||||
|
||||
request_handle();
|
||||
}
|
||||
}
|
||||
|
@ -602,17 +604,22 @@ catch(const std::exception &e)
|
|||
throw;
|
||||
}
|
||||
|
||||
void
|
||||
size_t
|
||||
ircd::m::fetch::request_cleanup()
|
||||
{
|
||||
size_t ret(0);
|
||||
auto it(begin(requests));
|
||||
while(it != end(requests))
|
||||
{
|
||||
if(it->finished && empty(it->buf))
|
||||
{
|
||||
it = requests.erase(it);
|
||||
else
|
||||
++it;
|
||||
++ret;
|
||||
}
|
||||
else ++it;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace ircd::m::fetch
|
|||
static void eval_worker();
|
||||
static void request_handle(const decltype(requests)::iterator &);
|
||||
static void request_handle();
|
||||
static void request_cleanup();
|
||||
static size_t request_cleanup();
|
||||
static void request_worker();
|
||||
static void hook_handler(const event &, vm::eval &);
|
||||
static void init();
|
||||
|
|
Loading…
Reference in a new issue