0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-12 13:01:07 +01:00

ircd:Ⓜ️:media: Optimize file room writes w/ journal bypass.

This commit is contained in:
Jason Volk 2022-08-10 12:44:56 -07:00
parent 9f72d7e037
commit ed50a9f360
2 changed files with 13 additions and 0 deletions

View file

@ -18,6 +18,7 @@ namespace ircd::m::media
extern log::log log;
extern conf::item<size_t> events_prefetch;
extern conf::item<seconds> download_timeout;
extern conf::item<size_t> journal_threshold;
extern std::set<m::room::id> downloading;
extern ctx::dock downloading_dock;
}

View file

@ -21,6 +21,13 @@ ircd::m::media::events_prefetch
{ "default", 16L },
};
decltype(ircd::m::media::journal_threshold)
ircd::m::media::journal_threshold
{
{ "name", "ircd.m.media.journal.threshold" },
{ "default", 0L },
};
decltype(ircd::m::media::downloading)
ircd::m::media::downloading;
@ -112,6 +119,11 @@ try
};
m::vm::copts vmopts;
// Disable the WAL for file rooms
if(size(content) >= size_t(journal_threshold))
vmopts.wopts.sopts.journal = false;
const m::room room
{
room_id, &vmopts