mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd:Ⓜ️ Fix the m::cached logic to discount missing values.
This commit is contained in:
parent
655d4e41c6
commit
d5956f47f7
1 changed files with 10 additions and 4 deletions
|
@ -247,13 +247,13 @@ bool
|
|||
ircd::m::cached(const event::idx &event_idx,
|
||||
const event::fetch::opts &opts)
|
||||
{
|
||||
const byte_view<string_view> key
|
||||
const auto &select(opts.keys);
|
||||
auto &columns(dbs::event_column);
|
||||
const byte_view<string_view> &key
|
||||
{
|
||||
event_idx
|
||||
};
|
||||
|
||||
const auto &select(opts.keys);
|
||||
auto &columns(dbs::event_column);
|
||||
return std::all_of(begin(select), end(select), [&opts, &key, &columns]
|
||||
(const string_view &colname)
|
||||
{
|
||||
|
@ -267,7 +267,13 @@ ircd::m::cached(const event::idx &event_idx,
|
|||
columns.at(idx)
|
||||
};
|
||||
|
||||
return db::cached(column, key, opts.gopts);
|
||||
if(db::cached(column, key, opts.gopts))
|
||||
return true;
|
||||
|
||||
if(!db::has(column, key, opts.gopts))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue