windows: handle large mapsizes gracefully

Update nostrdb to gracefully handle mapsizes that
are too large and fail to create nostrdb files.

We now keep shrinking the mapsize until database creation
succeeds. We still use the default mapsize of 32GiB on
windows, which is a bit annoying until we have nostrdb
resizing like monero.

Fixes: https://github.com/damus-io/notedeck/issues/491
This commit is contained in:
William Casarin
2024-11-28 16:40:18 -08:00
parent dea2873d9a
commit 8d59260935
4 changed files with 74 additions and 76 deletions

View File

@@ -402,8 +402,7 @@ impl Damus {
let imgcache_dir = path.path(DataPathType::Cache).join(ImageCache::rel_dir());
let _ = std::fs::create_dir_all(imgcache_dir.clone());
let mut config = Config::new();
config.set_ingester_threads(4);
let config = Config::new().set_ingester_threads(4);
let keystore = if parsed_args.use_keystore {
let keys_path = path.path(DataPathType::Keys);
@@ -587,8 +586,7 @@ impl Damus {
let app_rect_handler = AppSizeHandler::new(&path);
let support = Support::new(&path);
let mut config = Config::new();
config.set_ingester_threads(2);
let config = Config::new().set_ingester_threads(2);
Self {
debug,