新增时向grimoirelab推送事件,异常处理
This commit is contained in:
parent
48fe09345e
commit
e907cae4dc
|
@ -161,6 +161,7 @@ class IssueWebhookJob < ApplicationJob
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
begin
|
||||||
url = URI("http://117.50.185.50:80")
|
url = URI("http://117.50.185.50:80")
|
||||||
http = Net::HTTP.new(url.host, url.port)
|
http = Net::HTTP.new(url.host, url.port)
|
||||||
request = Net::HTTP::Post.new(url)
|
request = Net::HTTP::Post.new(url)
|
||||||
|
@ -176,6 +177,10 @@ class IssueWebhookJob < ApplicationJob
|
||||||
|
|
||||||
response = http.request(request)
|
response = http.request(request)
|
||||||
Rails.logger.info "issue webhook event======#{response.read_body}"
|
Rails.logger.info "issue webhook event======#{response.read_body}"
|
||||||
|
rescue Exception => e
|
||||||
|
Rails.logger.info "issue webhook event error======#{e.message}"
|
||||||
|
puts "issue webhook event error======#{e.message}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue