add: user and platform cache

This commit is contained in:
2021-06-08 11:51:46 +08:00
parent a5b98bcad4
commit 02fe8a8966
29 changed files with 866 additions and 138 deletions

View 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

View 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