feat: update with web assembly components
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -2,14 +2,17 @@ use std::collections::BTreeMap;
|
||||
|
||||
use crate::agent::{
|
||||
actions::Plan,
|
||||
plugins::PluginStore,
|
||||
task::{ConcreteTask, IntoTask},
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ScheduledTasks {}
|
||||
pub struct ScheduledTasks {
|
||||
store: PluginStore,
|
||||
}
|
||||
impl ScheduledTasks {
|
||||
pub fn new() -> Self {
|
||||
Self {}
|
||||
pub fn new(store: PluginStore) -> Self {
|
||||
Self { store }
|
||||
}
|
||||
|
||||
pub async fn handle(
|
||||
@@ -19,7 +22,7 @@ impl ScheduledTasks {
|
||||
) -> anyhow::Result<()> {
|
||||
tracing::info!("scheduling: {}", task);
|
||||
|
||||
let plan = Plan::new();
|
||||
let plan = Plan::new(self.store.clone());
|
||||
let tasks: Vec<ConcreteTask> = plan
|
||||
.tasks()
|
||||
.await?
|
||||
@@ -28,12 +31,13 @@ impl ScheduledTasks {
|
||||
.collect();
|
||||
|
||||
for task in tasks {
|
||||
let id = task.id().await?;
|
||||
if !task.should_run().await? {
|
||||
tracing::debug!(task = task.id(), "skipping run");
|
||||
tracing::debug!(task = id, "skipping run");
|
||||
continue;
|
||||
}
|
||||
|
||||
tracing::info!(task = task.id(), "executing task");
|
||||
tracing::info!(task = id, "executing task");
|
||||
task.execute().await?;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user