0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 10:08:56 +02:00

ircd:Ⓜ️ Fix the m::cached logic to discount missing values.

This commit is contained in:
Jason Volk 2019-01-11 17:38:33 -08:00
parent 655d4e41c6
commit d5956f47f7

View file

@ -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;
});
}