move main engine in worker
This commit is contained in:
+17
-6
@@ -1,11 +1,10 @@
|
||||
use crate::database::get_connection;
|
||||
use std::time::Duration;
|
||||
use std::{thread, time};
|
||||
|
||||
use super::{Runner, RunnerStatus, Storer};
|
||||
use crate::error::StorerError;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum JobAction {
|
||||
MegaportDeploy,
|
||||
MegaportUndeploy,
|
||||
@@ -40,16 +39,28 @@ impl Runner for Job {
|
||||
|
||||
match self.action {
|
||||
JobAction::MegaportDeploy => {
|
||||
println!("[job({:?})] deploying megaport...", self);
|
||||
println!(
|
||||
"[job({} - {:?} - {:?})] deploying megaport...",
|
||||
self.id, self.action, self.status
|
||||
);
|
||||
}
|
||||
JobAction::MegaportUndeploy => {
|
||||
println!("[job({:?})] undeploying megaport...", self);
|
||||
println!(
|
||||
"[job({} - {:?} - {:?})] undeploying megaport...",
|
||||
self.id, self.action, self.status
|
||||
);
|
||||
}
|
||||
JobAction::MegaportCheckDeploy => {
|
||||
println!("[job({:?})] ckecking megaport deployment...", self);
|
||||
println!(
|
||||
"[job({} - {:?} - {:?})] checking megaport deployement...",
|
||||
self.id, self.action, self.status
|
||||
);
|
||||
}
|
||||
JobAction::MegaportCheckUndeploy => {
|
||||
println!("[job({:?})] ckecking megaport undeployment...", self);
|
||||
println!(
|
||||
"[job({} - {:?} - {:?})] checking megaport undeployement...",
|
||||
self.id, self.action, self.status
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use crate::error::StorerError;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum RunnerStatus {
|
||||
Pending,
|
||||
Running,
|
||||
|
||||
Reference in New Issue
Block a user