mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 00:34:18 +01:00
ircd:Ⓜ️:room: Make the state iteration readahead value a conf item.
This commit is contained in:
parent
8af997ab2e
commit
9d7032e29e
2 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue