impl notification + add Rocket endpoints

This commit is contained in:
rmanach
2023-04-20 16:03:48 +02:00
parent 45a29cf395
commit e1e8085955
8 changed files with 1006 additions and 50 deletions
+4 -2
View File
@@ -1,10 +1,12 @@
use std::{thread, time};
use rocket::serde::Serialize;
use super::{Runner, RunnerStatus, Storer};
use crate::error::{MessageError, RunnerError, StorerError};
use crate::message::{Message, Subject};
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Serialize)]
pub enum JobAction {
Deploy,
Check,
@@ -34,7 +36,7 @@ impl Job {
self.set_status(RunnerStatus::Running);
println!("{} {}", self.format_job(), "deploying...");
let wait = time::Duration::from_millis(5);
let wait = time::Duration::from_secs(5);
thread::sleep(wait);
self.set_status(RunnerStatus::Success);