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.
</commit_message>
This commit is contained in:
songtianlun 2025-02-16 01:08:49 +08:00
parent 2f84dde40f
commit 0af41e24a8

View File

@ -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