summaryrefslogtreecommitdiff
path: root/shared/src/store.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-09 01:41:33 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-09 01:41:38 +0100
commit060a94327220a61d72b2f064b2d170639bff866a (patch)
tree76cef3bdc733ece3c2937cefffb384087a3b2557 /shared/src/store.rs
parenta7a68de71c2e9e8f714ec58053c9ea57fae70604 (diff)
downloadweareserver-060a94327220a61d72b2f064b2d170639bff866a.tar
weareserver-060a94327220a61d72b2f064b2d170639bff866a.tar.bz2
weareserver-060a94327220a61d72b2f064b2d170639bff866a.tar.zst
create T_ENTRIES table in resource cache on startup
Diffstat (limited to 'shared/src/store.rs')
-rw-r--r--shared/src/store.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/shared/src/store.rs b/shared/src/store.rs
index 976960e..37e3ab1 100644
--- a/shared/src/store.rs
+++ b/shared/src/store.rs
@@ -28,7 +28,11 @@ pub enum ResourceStore {
}
impl ResourceStore {
pub fn new_persistent(path: &Path) -> Result<Self> {
- Ok(Self::Redb(Database::create(path)?))
+ let db = Database::create(path)?;
+ let txn = db.begin_write()?;
+ txn.open_table(T_ENTRIES)?;
+ txn.commit()?;
+ Ok(Self::Redb(db))
}
pub fn new_memory() -> Self {
Self::Memory(HashMap::new().into())