damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 3605edad8b7fe3f1cc7a8bdc70cbe6208ab9ff2d
parent 04c207a11a49b2f744f0a5dfc25ca7e69d3b6e60
Author: William Casarin <jb55@jb55.com>
Date:   Fri,  1 Dec 2023 13:17:25 -0800

nostrdb/config: fix ingester thread settings

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mnostrdb/nostrdb.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/nostrdb/nostrdb.c b/nostrdb/nostrdb.c @@ -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)