Skip to main content

tuwunel_admin/debug/
resync_database.rs

1use tuwunel_core::{Err, Result, err};
2
3use crate::admin_command;
4
5#[admin_command]
6pub(super) async fn resync_database(&self) -> Result {
7	if !self.services.db.is_secondary() {
8		return Err!("Not a secondary instance.");
9	}
10
11	self.services
12		.db
13		.engine
14		.update()
15		.map_err(|e| err!("Failed to update from primary: {e:?}"))
16}