ndb: add subscription callback initializers

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-04-04 14:14:15 -07:00
committed by Daniel D’Aquino
parent 475940aa01
commit 744bf4bb07

View File

@@ -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