Merge branch 'pre_trustie_server' into trustie_server
This commit is contained in:
commit
06635e8bb6
|
@ -37,6 +37,7 @@ class SendTemplateMessageJob < ApplicationJob
|
||||||
issue = Issue.find_by_id(issue_id)
|
issue = Issue.find_by_id(issue_id)
|
||||||
return unless operator.present? && issue.present?
|
return unless operator.present? && issue.present?
|
||||||
# receivers = receivers.where.not(id: operator&.id)
|
# receivers = receivers.where.not(id: operator&.id)
|
||||||
|
receivers = User.where(id: receivers)
|
||||||
receivers_string, content, notification_url = MessageTemplate::IssueAtme.get_message_content(receivers, operator, issue)
|
receivers_string, content, notification_url = MessageTemplate::IssueAtme.get_message_content(receivers, operator, issue)
|
||||||
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, issue_id: issue.id}, 2, operator_id)
|
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, issue_id: issue.id}, 2, operator_id)
|
||||||
when 'IssueChanged'
|
when 'IssueChanged'
|
||||||
|
@ -235,6 +236,7 @@ class SendTemplateMessageJob < ApplicationJob
|
||||||
pull_request = PullRequest.find_by_id(pull_request_id)
|
pull_request = PullRequest.find_by_id(pull_request_id)
|
||||||
return unless operator.present? && pull_request.present?
|
return unless operator.present? && pull_request.present?
|
||||||
# receivers = receivers.where.not(id: operator&.id)
|
# receivers = receivers.where.not(id: operator&.id)
|
||||||
|
receivers = User.where(id: receivers)
|
||||||
receivers_string, content, notification_url = MessageTemplate::PullRequestAtme.get_message_content(receivers, operator, pull_request)
|
receivers_string, content, notification_url = MessageTemplate::PullRequestAtme.get_message_content(receivers, operator, pull_request)
|
||||||
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, pull_request_id: pull_request.id}, 2, operator_id)
|
Notice::Write::CreateService.call(receivers_string, content, notification_url, source, {operator_id: operator.id, pull_request_id: pull_request.id}, 2, operator_id)
|
||||||
when 'PullRequestChanged'
|
when 'PullRequestChanged'
|
||||||
|
|
|
@ -155,7 +155,7 @@ class Issue < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_collaborators?
|
def is_collaborators?
|
||||||
self.assigned_to_id.present? ? self.project.members.where(user_id: self.assigned_to_id).present? : false
|
self.assigned_to_id.present? ? self.project.member?(self.assigned_to_id) : false
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_issue_tags_name
|
def get_issue_tags_name
|
||||||
|
|
|
@ -32,6 +32,6 @@ class AtmeService < ApplicationService
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
SendTemplateMessageJob.perform_now(message_source, receivers, user.id, @atmeable.id) if Site.has_notice_menu?
|
SendTemplateMessageJob.perform_later(message_source, receivers.pluck(:id), user.id, @atmeable.id) if Site.has_notice_menu?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,8 @@ class Notice::Write::ClientService < ApplicationService
|
||||||
req.request :url_encoded
|
req.request :url_encoded
|
||||||
req.headers['Content-Type'] = 'application/json'
|
req.headers['Content-Type'] = 'application/json'
|
||||||
req.adapter Faraday.default_adapter
|
req.adapter Faraday.default_adapter
|
||||||
|
req.options.timeout = 100 # open/read timeout in seconds
|
||||||
|
req.options.open_timeout = 10 # connection open timeout in seconds
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue