From 744bf4bb070bbdf3ead86495bab2efd8bb56bb09 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 4 Apr 2024 14:14:15 -0700 Subject: [PATCH] ndb: add subscription callback initializers Signed-off-by: William Casarin --- nostrdb/Ndb.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nostrdb/Ndb.swift b/nostrdb/Ndb.swift index 35aa0479..d86ec72b 100644 --- a/nostrdb/Ndb.swift +++ b/nostrdb/Ndb.swift @@ -110,9 +110,8 @@ class Ndb { let ok = path.withCString { testdir in var ok = false while !ok && mapsize > 1024 * 1024 * 700 { - var cfg = ndb_config(flags: 0, ingester_threads: ingest_threads, mapsize: mapsize, filter_context: nil, ingest_filter: nil) - let res = ndb_init(&ndb_p, testdir, &cfg) - ok = res != 0; + var cfg = ndb_config(flags: 0, ingester_threads: ingest_threads, mapsize: mapsize, filter_context: nil, ingest_filter: nil, sub_cb_ctx: nil, sub_cb: nil) + ok = ndb_init(&ndb_p, testdir, &cfg) != 0 if !ok { Log.error("ndb_init failed: %d, reducing mapsize from %d to %d", for: .storage, res, mapsize, mapsize / 2) mapsize /= 2