feat: add queue
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-11-24 21:24:50 +01:00
parent ea5adb2f93
commit 6647bb89be
Signed by: kjuulh
GPG Key ID: D85D7535F18F35FA
4 changed files with 5 additions and 9 deletions

View File

@ -3,12 +3,8 @@ use std::{ops::Deref, sync::Arc};
use crate::api::Discovery;
use super::{
config::AgentConfig,
discovery_client::DiscoveryClient,
grpc_client::GrpcClient,
handlers::scheduled_tasks::{self, ScheduledTasks},
queue::AgentQueue,
scheduler::Scheduler,
config::AgentConfig, discovery_client::DiscoveryClient, grpc_client::GrpcClient,
handlers::scheduled_tasks::ScheduledTasks, queue::AgentQueue, scheduler::Scheduler,
};
#[derive(Clone)]

View File

@ -14,6 +14,8 @@ impl ScheduledTasks {
task: &str,
_properties: BTreeMap<String, String>,
) -> anyhow::Result<()> {
tracing::info!("scheduling: {}", task);
// Get plan
let plan = Plan::new();
let tasks = plan.tasks().await?;

View File

@ -3,7 +3,7 @@ use std::sync::Arc;
use notmad::{Component, MadError};
use tokio::sync::Mutex;
use super::{handlers::scheduled_tasks::ScheduledTasks, models::Commands, scheduler::Scheduler};
use super::{models::Commands, scheduler::Scheduler};
#[derive(Clone)]
pub struct AgentQueue {

View File

@ -1,7 +1,5 @@
use std::collections::BTreeMap;
use anyhow::Context;
use crate::agent::models::Commands;
use super::{agent_state::AgentState, queue::AgentQueue};