From 8663efc73bf9bc38b21813641e9b03e5aa8d621b Mon Sep 17 00:00:00 2001 From: yystopf Date: Tue, 11 Apr 2023 14:10:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BB=B6=E8=BF=9F5=E7=A7=92=E8=A7=A6?= =?UTF-8?q?=E5=8F=91webhook?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/api/v1/issues/create_service.rb | 2 +- app/services/api/v1/issues/journals/create_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/api/v1/issues/create_service.rb b/app/services/api/v1/issues/create_service.rb index ce24c8b49..b930a91b1 100644 --- a/app/services/api/v1/issues/create_service.rb +++ b/app/services/api/v1/issues/create_service.rb @@ -69,7 +69,7 @@ class Api::V1::Issues::CreateService < ApplicationService end # 触发webhook - TouchWebhookJob.perform_later('IssueCreate', @created_issue&.id, current_user.id) + TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueCreate', @created_issue&.id, current_user.id) TouchWebhookJob.perform_later('IssueLabel', @created_issue&.id, current_user.id, issue_tag_ids) unless issue_tag_ids.blank? TouchWebhookJob.perform_later('IssueAssign', @created_issue&.id, current_user.id, assigner_ids) unless assigner_ids.blank? unlock("Api::V1::Issues::CreateService:#{project.id}") # 结束写数据,解锁 diff --git a/app/services/api/v1/issues/journals/create_service.rb b/app/services/api/v1/issues/journals/create_service.rb index 3121a635d..e60acb8b3 100644 --- a/app/services/api/v1/issues/journals/create_service.rb +++ b/app/services/api/v1/issues/journals/create_service.rb @@ -41,7 +41,7 @@ class Api::V1::Issues::Journals::CreateService < ApplicationService # @信息发送 AtmeService.call(current_user, @atme_receivers, @created_journal) unless receivers_login.blank? - TouchWebhookJob.perform_later('IssueComment', @issue&.id, @current_user.id, @created_journal.id, 'created', {}) + TouchWebhookJob.set(wait: 5.seconds).perform_later('IssueComment', @issue&.id, @current_user.id, @created_journal.id, 'created', {}) unlock("Api::V1::Issues::Journals::CreateService:#{@issue.id}") @created_journal