fix bug where meta files where not auto-created upon starting + fix bug where meta json files were actually binary + improved access control to database instances

This commit is contained in:
Maxime Van Hees
2025-09-15 10:34:03 +02:00
parent bdf363016a
commit da325a9659
2 changed files with 24 additions and 77 deletions

View File

@@ -76,9 +76,12 @@ async fn main() {
// new server
let mut server = server::Server::new(option).await;
// Initialize the default database storage
// Initialize the default database storage (creates 0.db)
let _ = server.current_storage();
// Ensure default meta for DB 0 exists (public by default if missing)
let _ = herodb::rpc::RpcServerImpl::load_meta_static(&server.option.dir, 0).await;
// Add a small delay to ensure the port is ready
tokio::time::sleep(std::time::Duration::from_millis(100)).await;