From 7b64c7404627efc76cb95cd36f4aacca973c2d29 Mon Sep 17 00:00:00 2001 From: Jannik Date: Fri, 27 Dec 2024 15:25:09 +0100 Subject: [PATCH] :wrench: add configuration option for year-in-review per scheduler (#3062) Co-authored-by: Kris Co-authored-by: Chris --- .env.example | 1 + app/Console/Kernel.php | 2 +- config/trwl.php | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 75261c04c..dba0c55a3 100644 --- a/.env.example +++ b/.env.example @@ -60,6 +60,7 @@ MIX_LEGAL_TEL="01234 / 56789" # Should the year in review be visible to the users? YEAR_IN_REVIEW_BACKEND=false YEAR_IN_REVIEW_ALERT=false +YEAR_IN_REVIEW_SCHEDULER=false # Should the scheduler calculate the year in review for all users daily? If deactivated, it will be calculated upon request. # Telegram Bot credentials - used for admin notifications TELEGRAM_ADMIN_ACTIVE=false # Set to true to enable Telegram notifications diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 7e0ac1908..e6943894d 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -48,7 +48,7 @@ protected function schedule(Schedule $schedule): void { //weekly tasks $schedule->command(MastodonServers::class)->weekly(); - if (config('trwl.year_in_review.backend')) { + if (config('trwl.year_in_review.scheduler')) { $schedule->command(CacheYearInReview::class)->withoutOverlapping()->dailyAt('2:00'); } } diff --git a/config/trwl.php b/config/trwl.php index afb183b2a..9ef917360 100644 --- a/config/trwl.php +++ b/config/trwl.php @@ -59,8 +59,9 @@ 'hafas' => env('HAFAS_CACHE', false), ], 'year_in_review' => [ - 'alert' => env('YEAR_IN_REVIEW_ALERT', false), - 'backend' => env('YEAR_IN_REVIEW_BACKEND', false), + 'alert' => env('YEAR_IN_REVIEW_ALERT', false), + 'backend' => env('YEAR_IN_REVIEW_BACKEND', false), + 'scheduler' => env('YEAR_IN_REVIEW_SCHEDULER', false), ], 'webhooks_active' => env('WEBHOOKS_ACTIVE', false), 'webfinger_active' => env('WEBFINGER_ACTIVE', false),