mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +00:00
chore: Add timeouts to requests (#2024)
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
class Webhooks::Trigger
|
||||
def self.execute(url, payload)
|
||||
RestClient.post(url, payload.to_json, { content_type: :json, accept: :json })
|
||||
RestClient::Request.execute(
|
||||
method: :post,
|
||||
url: url, payload: payload.to_json,
|
||||
headers: { content_type: :json, accept: :json },
|
||||
timeout: 5
|
||||
)
|
||||
rescue *ExceptionList::REST_CLIENT_EXCEPTIONS, *ExceptionList::URI_EXCEPTIONS => e
|
||||
Rails.logger.info "Exception: invalid webhook url #{url} : #{e.message}"
|
||||
rescue StandardError => e
|
||||
|
||||
Reference in New Issue
Block a user