0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

modules/media/media: Make conf items for blocks cache size.

This commit is contained in:
Jason Volk 2018-09-04 20:33:22 -07:00
parent d3a8a57295
commit 1edab7bb15

View file

@ -10,6 +10,32 @@
#include "media.h" #include "media.h"
conf::item<size_t>
media_blocks_cache_size
{
{
{ "name", "ircd.media.blocks.cache.size" },
{ "default", long(48_MiB) },
}, []
{
const size_t &value{media_blocks_cache_size};
db::capacity(db::cache(blocks), value);
}
};
conf::item<size_t>
media_blocks_cache_comp_size
{
{
{ "name", "ircd.media.blocks.cache_comp.size" },
{ "default", long(16_MiB) },
}, []
{
const size_t &value{media_blocks_cache_comp_size};
db::capacity(db::cache_compressed(blocks), value);
}
};
// Blocks column // Blocks column
const db::database::descriptor const db::database::descriptor
media_blocks_descriptor media_blocks_descriptor
@ -29,8 +55,11 @@ media_blocks_descriptor
typeid(string_view), typeid(string_view) typeid(string_view), typeid(string_view)
}, },
// options {}, // options
{} {}, // comparaor
{}, // prefix transform
-1, // cache size (uses conf item)
-1, // compressed cache size (uses conf item)
}; };
const db::database::description const db::database::description