mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd:Ⓜ️:prefetch: Prefetch index; prevent blocking on translation.
This commit is contained in:
parent
30d4a89db9
commit
ae2d112612
1 changed files with 17 additions and 2 deletions
|
@ -12,14 +12,29 @@ bool
|
|||
ircd::m::prefetch(const event::id &event_id,
|
||||
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
|
||||
ircd::m::prefetch(const event::id &event_id,
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue