0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-10 05:58:56 +02:00

modules/s_fetch: Report nr of reaped requests.

This commit is contained in:
Jason Volk 2019-04-12 13:03:08 -07:00
parent 12109be1a7
commit 1063fcb657
2 changed files with 12 additions and 5 deletions

View file

@ -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

View file

@ -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();