0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 16:30:52 +01:00

modules/m_vm_fetch: Workaround for loss of PDU lookahead and the zealous fetch problem.

This commit is contained in:
Jason Volk 2020-04-15 19:43:28 -07:00
parent d1a5930ba9
commit 2eb5300713

View file

@ -560,11 +560,19 @@ ircd::m::vm::fetch::prev(const event &event,
prev.prev_events_count() prev.prev_events_count()
}; };
const size_t prev_exists size_t prev_exists
{ {
prev.prev_events_exist() prev.prev_events_exist()
}; };
//TODO: remove or soften when eval::count() / eval::find_pdu()
//TODO: is restored kthx (though it can never truly be removed)
for(size_t check(0); prev_exists < prev_count && check < 3;)
{
ctx::sleep(milliseconds(++check * 333));
prev_exists = prev.prev_events_exist();
}
assert(prev_exists <= prev_count); assert(prev_exists <= prev_count);
if(prev_count == prev_exists) if(prev_count == prev_exists)
return; return;