add id getter for message body

This commit is contained in:
rmanach
2023-04-18 21:28:27 +02:00
parent 0c3a8acae0
commit 6d26f1032d
2 changed files with 14 additions and 3 deletions
+6 -3
View File
@@ -19,7 +19,7 @@ impl CheckHandler {
impl Handler for CheckHandler {
fn handle(&self, res: Result<Message, String>) {
match res {
Ok(_m) => todo!(),
Ok(_m) => (),
Err(_e) => todo!(),
}
}
@@ -36,12 +36,15 @@ impl DeployHandler {
fn manage_message(&self, message: Message) {
match message {
Message::CheckDeploy(_body) => {
Message::CheckDeploy(body) => {
let guard = self.sender.lock().unwrap();
if let Err(e) = guard.send(Job::new(1, JobAction::MegaportCheckDeploy)) {
let id: i32 = body.get_id().try_into().unwrap();
if let Err(e) = guard.send(Job::new(id, JobAction::MegaportCheckDeploy)) {
println!("[handler(deploy)] error: {}", e);
}
}
Message::StopManager => todo!(),
}
}
}