1
0
mirror of git://jb55.com/damus synced 2024-10-04 10:50:43 +00:00

nostrdb/config: fix ingester thread settings

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2023-12-01 13:17:25 -08:00
parent 04c207a11a
commit 3605edad8b

View File

@ -4398,8 +4398,9 @@ inline int ndb_builder_push_tag_str(struct ndb_builder *builder,
//
void ndb_default_config(struct ndb_config *config)
{
int cores = get_physical_cores();
config->mapsize = 1024UL * 1024UL * 1024UL * 32UL; // 32 GiB
config->ingester_threads = 4; // TODO: figure this out from platform apis
config->ingester_threads = cores == -1 ? 4 : cores;
config->flags = 0;
config->ingest_filter = NULL;
config->filter_context = NULL;
@ -4407,8 +4408,7 @@ void ndb_default_config(struct ndb_config *config)
void ndb_config_set_ingest_threads(struct ndb_config *config, int threads)
{
int cores = get_physical_cores();
config->ingester_threads = cores == -1 ? 4 : cores;
config->ingester_threads = threads;
}
void ndb_config_set_flags(struct ndb_config *config, int flags)