aboutsummaryrefslogtreecommitdiff
path: root/src/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.rs')
-rw-r--r--src/server.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/server.rs b/src/server.rs
index 3df6ca59..b62c18cc 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -24,6 +24,7 @@ pub struct Garage {
pub object_table: Arc<Table<ObjectTable>>,
pub version_table: Arc<Table<VersionTable>>,
+ pub block_ref_table: Arc<Table<BlockRefTable>>,
}
impl Garage {
@@ -55,6 +56,15 @@ impl Garage {
"version".to_string(),
meta_rep_param.clone(),
));
+ let block_ref_table = Arc::new(Table::new(
+ BlockRefTable {
+ garage: RwLock::new(None),
+ },
+ system.clone(),
+ &db,
+ "block_ref".to_string(),
+ meta_rep_param.clone(),
+ ));
let mut garage = Self {
db,
@@ -63,6 +73,7 @@ impl Garage {
table_rpc_handlers: HashMap::new(),
object_table,
version_table,
+ block_ref_table,
};
garage.table_rpc_handlers.insert(
@@ -73,11 +84,16 @@ impl Garage {
garage.version_table.name.clone(),
garage.version_table.clone().rpc_handler(),
);
+ garage.table_rpc_handlers.insert(
+ garage.block_ref_table.name.clone(),
+ garage.block_ref_table.clone().rpc_handler(),
+ );
let garage = Arc::new(garage);
*garage.object_table.instance.garage.write().await = Some(garage.clone());
*garage.version_table.instance.garage.write().await = Some(garage.clone());
+ *garage.block_ref_table.instance.garage.write().await = Some(garage.clone());
garage
}