新增:项目排行榜新增提交数算法

This commit is contained in:
2022-09-15 09:44:12 +08:00
parent 383660c778
commit 733f64eaec
4 changed files with 41 additions and 6 deletions

View File

@@ -3,4 +3,15 @@ class CommitLog < ApplicationRecord
belongs_to :project
belongs_to :repository
after_create :incre_project_common
after_destroy :decre_project_common
def incre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {commits: 1}, self.project_id)
end
def decre_project_common
CacheAsyncSetJob.perform_later("project_common_service", {commits: -1}, self.project_id)
end
end