修复:加入移除排行榜队列延迟五秒

This commit is contained in:
yystopf 2024-06-24 20:53:49 +08:00
parent 93ad4b046b
commit bad7be4266
1 changed files with 2 additions and 2 deletions

View File

@ -181,14 +181,14 @@ class Project < ApplicationRecord
end end
if changes[:is_public].present? if changes[:is_public].present?
if changes[:is_public][0] && !changes[:is_public][1] if changes[:is_public][0] && !changes[:is_public][1]
CacheAsyncClearJob.perform_later('project_rank_service', self.id) CacheAsyncClearJob.set(wait: 5.seconds).perform_later('project_rank_service', self.id)
end end
if !changes[:is_public][0] && changes[:is_public][1] if !changes[:is_public][0] && changes[:is_public][1]
$redis_cache.srem("v2-project-rank-deleted", self.id) $redis_cache.srem("v2-project-rank-deleted", self.id)
end end
end end
if !self.common? if !self.common?
CacheAsyncClearJob.perform_later('project_rank_service', self.id) CacheAsyncClearJob.set(wait: 5.seconds).perform_later('project_rank_service', self.id)
end end
end end