Skip to content

Commit

Permalink
config: fix ingester thread settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jb55 committed Dec 1, 2023
1 parent c0d2b49 commit 9f2ee78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nostrdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4398,17 +4398,17 @@ 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;
}

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)
Expand Down

0 comments on commit 9f2ee78

Please sign in to comment.