0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd:Ⓜ️:prefetch: Prefetch index; prevent blocking on translation.

This commit is contained in:
Jason Volk 2020-10-29 22:36:01 -07:00
parent 30d4a89db9
commit ae2d112612

View file

@ -12,14 +12,29 @@ bool
ircd::m::prefetch(const event::id &event_id, ircd::m::prefetch(const event::id &event_id,
const event::fetch::opts &opts) const event::fetch::opts &opts)
{ {
return prefetch(index(event_id), opts); if(prefetch(event_id, "_event_idx"))
return true;
if(prefetch(index(std::nothrow, event_id), opts))
return true;
return false;
} }
bool bool
ircd::m::prefetch(const event::id &event_id, ircd::m::prefetch(const event::id &event_id,
const string_view &key) const string_view &key)
{ {
return prefetch(index(event_id), key); if(db::prefetch(dbs::event_idx, event_id))
return true;
if(key == "_event_idx")
return false;
if(prefetch(index(std::nothrow, event_id), key))
return true;
return false;
} }
bool bool