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

ircd:Ⓜ️:room: Make the state iteration readahead value a conf item.

This commit is contained in:
Jason Volk 2018-11-02 20:05:11 -07:00
parent 8af997ab2e
commit 9d7032e29e
2 changed files with 11 additions and 3 deletions

View file

@ -255,6 +255,7 @@ struct ircd::m::room::state
using types_bool = std::function<bool (const string_view &)>;
static conf::item<bool> disable_history;
static conf::item<size_t> readahead_size;
room::id room_id;
event::id::buf event_id;

View file

@ -833,6 +833,13 @@ ircd::m::room::state::disable_history
{ "default", false },
};
decltype(ircd::m::room::state::readahead_size)
ircd::m::room::state::readahead_size
{
{ "name", "ircd.m.room.state.readahead_size" },
{ "default", 0L },
};
//
// room::state::state
//
@ -1187,7 +1194,7 @@ const
};
if(!opts.readahead)
opts.readahead = 0_KiB;
opts.readahead = size_t(readahead_size);
auto &column{dbs::room_state};
for(auto it{column.begin(room_id, opts)}; bool(it); ++it)
@ -1340,7 +1347,7 @@ const
};
if(!opts.readahead)
opts.readahead = 0_KiB;
opts.readahead = size_t(readahead_size);
auto &column{dbs::room_state};
for(auto it{column.begin(key, opts)}; bool(it); ++it)
@ -1401,7 +1408,7 @@ const
};
if(!opts.readahead)
opts.readahead = 0_KiB;
opts.readahead = size_t(readahead_size);
auto &column{dbs::room_state};
for(auto it{column.begin(key, opts)}; bool(it); ++it)