mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
add: user and platform cache
This commit is contained in:
14
app/jobs/reset_platform_cache_job.rb
Normal file
14
app/jobs/reset_platform_cache_job.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class ResetPlatformCacheJob < ApplicationJob
|
||||
queue_as :cache
|
||||
|
||||
def perform
|
||||
Cache::PlatformFollowCountService.new.reset
|
||||
Cache::PlatformIssueCountService.new.reset
|
||||
Cache::PlatformProjectCountService.new.reset
|
||||
Cache::PlatformProjectForkCountService.new.reset
|
||||
Cache::PlatformProjectLanguagesCountService.new.reset
|
||||
Cache::PlatformProjectPraisesCountService.new.reset
|
||||
Cache::PlatformProjectWatchersCountService.new.reset
|
||||
Cache::PlatformPullrequestCountService.new.reset
|
||||
end
|
||||
end
|
||||
14
app/jobs/reset_user_cache_job.rb
Normal file
14
app/jobs/reset_user_cache_job.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class ResetUserCacheJob < ApplicationJob
|
||||
queue_as :cache
|
||||
|
||||
def perform(user)
|
||||
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
|
||||
Reference in New Issue
Block a user