feat: add background processing for weather art generation

- Include Sidekiq::Worker for asynchronous task execution
- Implement condition to skip execution if weather data is up to date

These changes enable efficient weather art generation by leveraging
background processing, thereby improving overall application
performance and responsiveness.
This commit is contained in:
songtianlun 2025-01-23 09:43:37 +08:00
parent fd6292a81e
commit c5101fb822

View File

@ -1,4 +1,6 @@
class GenerateWeatherArtWorker
include Sidekiq::Worker
def perform(*args)
city = args[0]
return if city.last_weather_fetch&.today?