forgeplus/app/jobs/reset_user_cache_job.rb

15 lines
554 B
Ruby

class ResetUserCacheJob < ApplicationJob
queue_as :cache
def perform(user)
return if user.nil?
Cache::UserFollowCountService.new(user).reset
Cache::UserIssueCountService.new(user).reset
Cache::UserProjectCountService.new(user).reset
Cache::UserProjectForkCountService.new(user).reset
Cache::UserProjectLanguagesCountService.new(user).reset
Cache::UserProjectPraisesCountService.new(user).reset
Cache::UserProjectWatchersCountService.new(user).reset
Cache::UserPullrequestCountService.new(user).reset
end
end