From d8bd6ff6e1ffbf252484a8f92b835b32b484aef5 Mon Sep 17 00:00:00 2001 From: henneboy <72788863+henneboy@users.noreply.github.com> Date: Wed, 8 May 2024 15:35:35 +0200 Subject: [PATCH] Set default backend graph data to minutes --- backend/src/scheduling/background_service.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/scheduling/background_service.rs b/backend/src/scheduling/background_service.rs index 79fa73e7..8108cee4 100644 --- a/backend/src/scheduling/background_service.rs +++ b/backend/src/scheduling/background_service.rs @@ -113,9 +113,12 @@ async fn run_algorithm(pool: &SqlitePool, algorithm: &mut impl SchedulerAlgorith let values = vec![ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 28.0, 200.0, 484.0, 829.0, 1186.0, 1407.0, 1475.0, 1455.0, 1393.0, 1271.0, 1044.0, 754.0, 445.0, 154.0, 10.0, 0.0, 0.0, 0.0, - ]; + ] + .into_iter() + .flat_map(|v| vec![v; 60]) + .collect(); - let mut graph = DiscreteGraph::new(values, Duration::hours(1), Utc::now()); + let mut graph = DiscreteGraph::new(values, Duration::minutes(1), Utc::now()); let events = algorithm.schedule(&mut graph, tasks)?;