mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
modules/s_fetch: Fix gc iteration conditions.
This commit is contained in:
parent
c14d67102a
commit
8e5c858697
1 changed files with 18 additions and 3 deletions
|
@ -371,7 +371,13 @@ try
|
|||
return std::any_of(begin(requests), end(requests), []
|
||||
(const request &r)
|
||||
{
|
||||
return r.finished == 0;
|
||||
if(r.finished == 0)
|
||||
return true;
|
||||
|
||||
if(r.finished && empty(r.buf))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -500,6 +506,7 @@ ircd::m::fetch::eval_handle()
|
|||
{
|
||||
assert(!complete.empty());
|
||||
complete.pop_front();
|
||||
dock.notify_all();
|
||||
}};
|
||||
|
||||
const auto it
|
||||
|
@ -550,11 +557,19 @@ try
|
|||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
auto &request
|
||||
{
|
||||
const_cast<fetch::request &>(*it)
|
||||
};
|
||||
|
||||
if(!request.eptr)
|
||||
request.eptr = std::current_exception();
|
||||
|
||||
log::error
|
||||
{
|
||||
log, "fetch eval %s in %s :%s",
|
||||
string_view{it->event_id},
|
||||
string_view{it->room_id},
|
||||
string_view{request.event_id},
|
||||
string_view{request.room_id},
|
||||
e.what()
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue