Commit Graph

6 Commits

Author SHA1 Message Date
c5101fb822 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.
2025-01-23 09:43:37 +08:00
c529f5fd7b refactor: update job class for weather art generation
- Change from using GenerateWeatherArtJob to GenerateWeatherArtWorker
- Maintain asynchronous job processing

This refactoring improves the clarity of the job class being used
for generating weather art and adheres to project conventions. The
change does not affect the API rate limits as the sleep duration
remains the same.
2025-01-23 09:28:31 +08:00
c1fa16c690 refactor: change weather art job processing method
- Replace synchronous job processing with asynchronous
- Ensure processing does not exceed API rate limits

This change allows for better performance by offloading the
queue management to Sidekiq, enabling more efficient
parallel processing of weather art generation. It also
prevents potential API rate limit violations by maintaining
a delay between requests.
2025-01-23 09:20:49 +08:00
08c584b85b chore: rename job classes and update Sidekiq config
- Renamed `BatchGenerateWeatherArtsJob` to `BatchGenerateWeatherArtsWorker`
- Renamed `GenerateWeatherArtJob` to `GenerateWeatherArtWorker`
- Updated Sidekiq configuration to set Redis URL and logger level
- Modified `sidekiq.yml` to use the new worker class names and added queue configurations

These changes help in aligning the class names with their purpose as
workers in Sidekiq, while also ensuring better configuration for
Redis and logging.
2025-01-22 18:47:41 +08:00
78722caeb9 chore: update gem dependencies and formatting
- Standardized quotation marks in Gemfile and Ruby files
- Improved consistency for Sidekiq and Sidekiq Scheduler
- Removed unnecessary blank line in GenerateWeatherArtWorker class

These changes ensure a consistent coding style across the project, making
it easier to read and maintain. Adjustments to the Gemfile update the
formatting without altering the functionality.
2025-01-22 17:58:46 +08:00
2bcfea30ee feat: add background job processing with Sidekiq
- Implement BatchGenerateWeatherArtsWorker to handle batch
  processing of weather art generation.
- Create GenerateWeatherArtWorker for individual weather art
  generation tasks.
- Update Dockerfile to include redis-tools for Sidekiq support.
- Modify Gemfile to add sidekiq and sidekiq-scheduler gems.
- Configure Sidekiq in initializers and set up routes for
  Sidekiq dashboard.
- Include a sidekiq.yml configuration for scheduling jobs.
- Create compose.yaml for Docker services including web,
  database, Redis, and Sidekiq workers.

These changes introduce background processing capabilities
using Sidekiq, allowing for efficient generation of weather
art through scheduled and managed job queues, optimizing
performance and scalability.
2025-01-22 17:58:25 +08:00