From d1e9f2968b0132d68acad031bdbd8650b973c5ff Mon Sep 17 00:00:00 2001 From: Elad Kaplan Date: Thu, 6 Jun 2024 16:52:54 +0300 Subject: [PATCH 1/3] fix task generator in lightweight service --- starters/lightweight-service/src/app.rs | 7 ++++++- starters/lightweight-service/src/lib.rs | 1 + starters/lightweight-service/src/tasks/mod.rs | 0 starters/lightweight-service/tests/tasks/mod.rs | 0 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 starters/lightweight-service/src/tasks/mod.rs create mode 100644 starters/lightweight-service/tests/tasks/mod.rs diff --git a/starters/lightweight-service/src/app.rs b/starters/lightweight-service/src/app.rs index 6c1b0ca09..f34487f23 100644 --- a/starters/lightweight-service/src/app.rs +++ b/starters/lightweight-service/src/app.rs @@ -10,6 +10,8 @@ use loco_rs::{ }; use crate::controllers; +#[allow(unused_imports)] +use crate::tasks; pub struct App; #[async_trait] @@ -40,5 +42,8 @@ impl Hooks for App { fn connect_workers<'a>(_p: &'a mut Processor, _ctx: &'a AppContext) {} - fn register_tasks(_tasks: &mut Tasks) {} + #[allow(unused_variables)] + fn register_tasks(tasks: &mut Tasks) { + // tasks.register(TASK); + } } diff --git a/starters/lightweight-service/src/lib.rs b/starters/lightweight-service/src/lib.rs index 0827f2da8..020803328 100644 --- a/starters/lightweight-service/src/lib.rs +++ b/starters/lightweight-service/src/lib.rs @@ -1,3 +1,4 @@ pub mod app; pub mod controllers; +pub mod tasks; pub mod views; diff --git a/starters/lightweight-service/src/tasks/mod.rs b/starters/lightweight-service/src/tasks/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/starters/lightweight-service/tests/tasks/mod.rs b/starters/lightweight-service/tests/tasks/mod.rs new file mode 100644 index 000000000..e69de29bb From 9f2b081e920260d3ec0f2105097be6cc93eeebb6 Mon Sep 17 00:00:00 2001 From: Elad Kaplan Date: Thu, 6 Jun 2024 17:05:14 +0300 Subject: [PATCH 2/3] add tasks to tests --- starters/lightweight-service/tests/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/starters/lightweight-service/tests/mod.rs b/starters/lightweight-service/tests/mod.rs index c2e46cdd7..c788ab7cb 100644 --- a/starters/lightweight-service/tests/mod.rs +++ b/starters/lightweight-service/tests/mod.rs @@ -1 +1,2 @@ mod requests; +mod tasks; From e5ea2b5415088bf32a1b266fd837f9ca868eb28e Mon Sep 17 00:00:00 2001 From: Elad Kaplan Date: Thu, 6 Jun 2024 17:30:16 +0300 Subject: [PATCH 3/3] fmt --- starters/lightweight-service/src/tasks/mod.rs | 1 + starters/lightweight-service/tests/tasks/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/starters/lightweight-service/src/tasks/mod.rs b/starters/lightweight-service/src/tasks/mod.rs index e69de29bb..8b1378917 100644 --- a/starters/lightweight-service/src/tasks/mod.rs +++ b/starters/lightweight-service/src/tasks/mod.rs @@ -0,0 +1 @@ + diff --git a/starters/lightweight-service/tests/tasks/mod.rs b/starters/lightweight-service/tests/tasks/mod.rs index e69de29bb..8b1378917 100644 --- a/starters/lightweight-service/tests/tasks/mod.rs +++ b/starters/lightweight-service/tests/tasks/mod.rs @@ -0,0 +1 @@ +