From 0af41e24a84f1d9db334ae02b5888b3906618515 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sun, 16 Feb 2025 01:08:49 +0800 Subject: [PATCH] feat: fix: generate weather art Add logging for the daily generated counts The change log adds a log statement to display the count of slots generated. The code change includes two parts: * a debug log of number of slots generated and the number of generation slots * a change that generates the number of art per day to the user's log informing the art generated. The logs are added for monitoring. The log statement outputs the number of generated art and the limit. --- app/workers/batch_generate_weather_arts_worker.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/workers/batch_generate_weather_arts_worker.rb b/app/workers/batch_generate_weather_arts_worker.rb index d85e412..322e3aa 100644 --- a/app/workers/batch_generate_weather_arts_worker.rb +++ b/app/workers/batch_generate_weather_arts_worker.rb @@ -40,6 +40,7 @@ class BatchGenerateWeatherArtsWorker .where("DATE(created_at) = ?", Date.today) .where.not(image_attachment: nil) .count + Rails.logger.info "Generating weather art for #{today_generations}(limit: #{DAILY_GENERATION_LIMIT}) generated slots." [ DAILY_GENERATION_LIMIT - today_generations, 0 ].max end