From ec7474a04373c34c2dc55af69dd3ba5c662fcded Mon Sep 17 00:00:00 2001 From: Jonatan Ziegler Date: Thu, 28 Sep 2023 14:55:59 +0200 Subject: [PATCH] removed more old code --- backend/.env.example | 4 ---- backend/src/interface/mod.rs | 2 +- backend/src/layer/logic/api_command/test/mocks.rs | 2 +- backend/src/layer/trigger/scheduling/scheduler.rs | 5 ----- backend/src/startup/config.rs | 6 ++---- backend/tests/mensa_parse_scheduling.rs | 2 -- 6 files changed, 4 insertions(+), 17 deletions(-) diff --git a/backend/.env.example b/backend/.env.example index f2d5e88e..ccab132e 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -14,10 +14,6 @@ ADMIN_EMAIL= # --- scheduling --- #FULL_PARSE_SCHEDULE= #UPDATE_PARSE_SCHEDULE= -#IMAGE_REVIEW_SCHEDULE= - -# --- flickr --- -FLICKR_API_KEY= # --- mensa parser --- #CLIENT_TIMEOUT= diff --git a/backend/src/interface/mod.rs b/backend/src/interface/mod.rs index d4f4a225..39a5f8ad 100644 --- a/backend/src/interface/mod.rs +++ b/backend/src/interface/mod.rs @@ -1,4 +1,4 @@ -/// Module bundle for interface models +//! Module bundle for interface models pub mod admin_notification; pub mod api_command; pub mod file_handler; diff --git a/backend/src/layer/logic/api_command/test/mocks.rs b/backend/src/layer/logic/api_command/test/mocks.rs index b45edcea..63947d1e 100644 --- a/backend/src/layer/logic/api_command/test/mocks.rs +++ b/backend/src/layer/logic/api_command/test/mocks.rs @@ -1,4 +1,4 @@ -//! This crate contains mocks of [`CommandDataAccess`] and [`ImageHoster`] and [`AdminNotification`] for testing. +//! This crate contains mocks of [`CommandDataAccess`], [`FileHandler`], [`ImageValidation`] and [`AdminNotification`] for testing. use async_trait::async_trait; diff --git a/backend/src/layer/trigger/scheduling/scheduler.rs b/backend/src/layer/trigger/scheduling/scheduler.rs index 3ba488de..fd8c33b5 100644 --- a/backend/src/layer/trigger/scheduling/scheduler.rs +++ b/backend/src/layer/trigger/scheduling/scheduler.rs @@ -10,8 +10,6 @@ use tracing::{info, info_span, Instrument}; /// /// **Important:** Unlike regular cron expressions, seconds also have to be specified, see [here](https://lib.rs/crates/tokio-cron-scheduler). pub struct ScheduleInfo { - /// Cron-like schedule for running the image review process to check for no longer existing images, see [`ImageReviewScheduling`]. - pub image_review_schedule: String, /// Cron-like schedule for running the meal plan update process for the current day's meal plan, see [`MensaParseScheduling`]. pub update_parse_schedule: String, /// Cron-like schedule for running the meal plan update process for all available meal plan data, see [`MensaParseScheduling`]. @@ -161,7 +159,6 @@ mod tests { let info = ScheduleInfo { full_parse_schedule: "*/1 * * * * *".into(), update_parse_schedule: "*/2 * * * * *".into(), - image_review_schedule: "*/5 * * * * *".into(), }; let mensa_parser = MensaParseMock::default(); @@ -190,7 +187,6 @@ mod tests { let info = ScheduleInfo { full_parse_schedule: "*/1 * * * * *".into(), update_parse_schedule: "*/2 * * * * *".into(), - image_review_schedule: "*/5 * * * * *".into(), }; let mensa_parser = MensaParseMock::default(); @@ -206,7 +202,6 @@ mod tests { let info = ScheduleInfo { full_parse_schedule: "*/1 * * * * *".into(), update_parse_schedule: "*/2 * * * * *".into(), - image_review_schedule: "*/5 * * * * *".into(), }; let mensa_parser = MensaParseMock::default(); diff --git a/backend/src/startup/config.rs b/backend/src/startup/config.rs index 1df3232a..e109b468 100644 --- a/backend/src/startup/config.rs +++ b/backend/src/startup/config.rs @@ -101,12 +101,10 @@ impl ConfigReader { .unwrap_or_else(|_| DEFAULT_NIGHTLY_SCHEDULE.into()), update_parse_schedule: env::var("UPDATE_PARSE_SCHEDULE") .unwrap_or_else(|_| DEFAULT_UPDATE_PARSE_SCHEDULE.into()), - image_review_schedule: env::var("IMAGE_REVIEW_SCHEDULE") - .unwrap_or_else(|_| DEFAULT_NIGHTLY_SCHEDULE.into()), }; info!( - "Running full parsing on `{}`, update parsing on `{}` and image reviews on `{}`", - info.full_parse_schedule, info.update_parse_schedule, info.image_review_schedule + "Running full parsing on `{}` and update parsing on `{}`", + info.full_parse_schedule, info.update_parse_schedule ); Ok(info) } diff --git a/backend/tests/mensa_parse_scheduling.rs b/backend/tests/mensa_parse_scheduling.rs index f9511a16..20a41f83 100644 --- a/backend/tests/mensa_parse_scheduling.rs +++ b/backend/tests/mensa_parse_scheduling.rs @@ -18,7 +18,6 @@ async fn test_full_mensa_parse_scheduling() { let info = ScheduleInfo { full_parse_schedule: "0 */5 * * * *".to_string(), update_parse_schedule: NEVER.to_string(), - image_review_schedule: NEVER.to_string(), }; let mut scheduler = setup(info).await; scheduler.start().await; @@ -32,7 +31,6 @@ async fn test_update_mensa_parse_scheduling() { let info = ScheduleInfo { full_parse_schedule: NEVER.to_string(), update_parse_schedule: "0 */5 * * * *".to_string(), - image_review_schedule: NEVER.to_string(), }; let mut scheduler = setup(info).await; scheduler.start().await;