0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-30 02:32:43 +01:00

modules/client/sync/rooms/state: Use post-fetch key filter here for now; checkpoint.

This commit is contained in:
Jason Volk 2019-01-16 18:39:40 -08:00
parent a61d9e5d96
commit c5598ed60a

View file

@ -51,12 +51,10 @@ ircd::m::sync::_default_keys
}; };
decltype(ircd::m::sync::_default_fopts) decltype(ircd::m::sync::_default_fopts)
ircd::m::sync::_default_fopts{[] ircd::m::sync::_default_fopts
{ {
event::fetch::opts ret{_default_keys}; _default_keys
ret.query_json_force = true; };
return ret;
}()};
void void
ircd::m::sync::room_state_linear(data &data) ircd::m::sync::room_state_linear(data &data)
@ -97,21 +95,26 @@ ircd::m::sync::room_state_polylog_events(data &data)
const event::closure_idx each_idx{[&data, &array, &mutex] const event::closure_idx each_idx{[&data, &array, &mutex]
(const m::event::idx &event_idx) (const m::event::idx &event_idx)
{ {
const event::fetch event const event::fetch fetch
{ {
event_idx, std::nothrow, _default_fopts event_idx, std::nothrow, _default_fopts
}; };
if(!event.valid) if(!fetch.valid)
return; return;
const m::event event
{
fetch, event::keys{_default_keys}
};
const std::lock_guard<decltype(mutex)> lock{mutex}; const std::lock_guard<decltype(mutex)> lock{mutex};
data.commit(); data.commit();
array.append(event); array.append(event);
}}; }};
//TODO: conf //TODO: conf
std::array<event::idx, 16> md; std::array<event::idx, 32> md;
ctx::parallel<event::idx> parallel ctx::parallel<event::idx> parallel
{ {
m::sync::pool, md, each_idx m::sync::pool, md, each_idx