Skip to content

Commit

Permalink
re-execute mesh-function every 300 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
elmarx committed Aug 29, 2023
1 parent 878a7c6 commit 3f6196c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let routing_service = RoutingServiceImpl::new(handle, &interface_name);

let wg_mesh = WgMesh::new(peer_repository, routing_service, wireguard_device);
// TODO: loop/re-execute
wg_mesh.execute(&mesh_record).await?;

Ok(())
loop {
wg_mesh.execute(&mesh_record).await?;
sleep(Duration::from_secs(300)).await;
}
}
2 changes: 1 addition & 1 deletion src/mesh/wgmesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ where
}
}

pub async fn execute(self, mesh_record: &str) -> Result<(), error::WgMesh> {
pub async fn execute(&self, mesh_record: &str) -> Result<(), error::WgMesh> {
let interface_pubkey = self.wireguard.get_interface_pubkey()?;

// first, get a list of all Peers belonging to the mesh
Expand Down

0 comments on commit 3f6196c

Please sign in to comment.