fix: adjust timing for weather arts generation

- Increase MAX_DURATION to allow longer processing time.
- Double SLEEP_DURATION to reduce server load between runs.
- Raise PER_RUN_GENERATION_LIMIT to improve throughput.

These changes enhance the performance of the weather arts generation
job by allowing longer intervals and reducing the frequency of
interruptions while also accommodating additional requests per run.
This commit is contained in:
songtianlun 2025-03-06 09:22:40 +08:00
parent d8a2600998
commit 44f446c069

View File

@ -2,10 +2,10 @@ class BatchGenerateWeatherArtsWorker
include Sidekiq::Worker
GENERATION_INTERVAL = 36.hours
MAX_DURATION = 5.minutes
SLEEP_DURATION = 60.seconds
MAX_DURATION = 30.minutes
SLEEP_DURATION = 120.seconds
DAILY_GENERATION_LIMIT = 60 # 每日生成图片上限
PER_RUN_GENERATION_LIMIT = 2 # 每次运行生成图片上限
PER_RUN_GENERATION_LIMIT = 3 # 每次运行生成图片上限
def perform(*args)
lock_key = "batch_generate_weather_lock"