From 9ce96269df057cb82aa08430e5b8f4a94d1aeb4d Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Fri, 14 Apr 2023 19:25:28 +0100 Subject: [PATCH] decreased render time and fixed clear all --- src/animations.rs | 2 +- src/main.rs | 3 ++- src/render.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/animations.rs b/src/animations.rs index f533c9b..12f6058 100644 --- a/src/animations.rs +++ b/src/animations.rs @@ -406,7 +406,7 @@ pub async fn clear( } #[get("/clearall")] -pub async fn clearAll(action: &State>) -> String { +pub async fn clear_all(action: &State>) -> String { let r = action.lock().unwrap().send(Action::Clear); if r.is_err() || r.ok().is_none() { diff --git a/src/main.rs b/src/main.rs index 815e82d..cac6387 100644 --- a/src/main.rs +++ b/src/main.rs @@ -354,7 +354,8 @@ async fn main() -> GResult { animations::start_animation, animations::stop_animation, animations::clear, - animations::delete + animations::delete, + animations::clear_all, ], ) .manage(conn_pool_arc.clone()) diff --git a/src/render.rs b/src/render.rs index a73cdca..73e499c 100644 --- a/src/render.rs +++ b/src/render.rs @@ -343,7 +343,7 @@ impl Render { self.last = data.clone(); } - if time - self.last_update < 100 { + if time - self.last_update < 10 { println!("To Fast! Skiping"); return; }