调整Pm webhook逻辑

This commit is contained in:
呱呱呱 2023-11-02 10:57:09 +08:00
parent af002c731d
commit 8e658d4d12
1 changed files with 15 additions and 14 deletions

View File

@ -76,9 +76,9 @@ class Api::V1::Issues::CreateService < ApplicationService
end
project.del_project_issue_cache_delete_count # 把缓存里存储项目删除issue的个数清除掉
unless project.id.zero?
# 新增时向grimoirelab推送事件
IssueWebhookJob.set(wait: 5.seconds).perform_later(@created_issue.id) unless @project.id.zero?
IssueWebhookJob.set(wait: 5.seconds).perform_later(@created_issue.id)
# @信息发送
AtmeService.call(current_user, @atme_receivers, @created_issue) unless receivers_login.blank?
@ -90,9 +90,10 @@ class Api::V1::Issues::CreateService < ApplicationService
end
# 触发webhook
TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueCreate', @created_issue&.id, current_user.id) unless @project.id.zero?
TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueLabel', @created_issue&.id, current_user.id, {issue_tag_ids: [[], issue_tag_ids]}) unless issue_tag_ids.blank? && @project.id.zero?
TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueAssign', @created_issue&.id, current_user.id, {assigner_ids: [[], assigner_ids]}) unless assigner_ids.blank? && @project.id.zero?
TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueCreate', @created_issue&.id, current_user.id)
TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueLabel', @created_issue&.id, current_user.id, {issue_tag_ids: [[], issue_tag_ids]}) unless issue_tag_ids.blank?
TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueAssign', @created_issue&.id, current_user.id, {assigner_ids: [[], assigner_ids]}) unless assigner_ids.blank?
end
unlock("Api::V1::Issues::CreateService:#{project.id}") # 结束写数据,解锁
end