Add todos

This commit is contained in:
Joscha 2023-08-11 21:47:56 +02:00
parent a7afbea0b9
commit 9744d5c059
2 changed files with 2 additions and 0 deletions

View file

@ -100,6 +100,7 @@ pub async fn get(
.into_response()) .into_response())
} }
// TODO Move to /admin/queue/add
pub async fn post_enqueue( pub async fn post_enqueue(
Path(hash): Path<String>, Path(hash): Path<String>,
State(config): State<&'static Config>, State(config): State<&'static Config>,

View file

@ -63,6 +63,7 @@ impl Workers {
} }
pub fn should_abort_work(&self, name: &str) -> bool { pub fn should_abort_work(&self, name: &str) -> bool {
// TODO Abort if not in queue
let Some(info) = self.workers.get(name) else { return false; }; let Some(info) = self.workers.get(name) else { return false; };
let WorkerStatus::Working ( run) = &info.status else { return false; }; let WorkerStatus::Working ( run) = &info.status else { return false; };
let Some(oldest) = self.oldest_working_on(&run.hash) else { return false; }; let Some(oldest) = self.oldest_working_on(&run.hash) else { return false; };