feat: Customizable webhook timeout configuration (#12777)
## Summary - Ability to configure the webhook timeout for Chatwoot self hosted installations fixes: https://github.com/chatwoot/chatwoot/issues/12754
This commit is contained in:
@@ -26,7 +26,7 @@ class Webhooks::Trigger
|
||||
url: @url,
|
||||
payload: @payload.to_json,
|
||||
headers: { content_type: :json, accept: :json },
|
||||
timeout: 5
|
||||
timeout: webhook_timeout
|
||||
)
|
||||
end
|
||||
|
||||
@@ -73,4 +73,11 @@ class Webhooks::Trigger
|
||||
def message_id
|
||||
@payload[:id]
|
||||
end
|
||||
|
||||
def webhook_timeout
|
||||
raw_timeout = GlobalConfig.get_value('WEBHOOK_TIMEOUT')
|
||||
timeout = raw_timeout.presence&.to_i
|
||||
|
||||
timeout&.positive? ? timeout : 5
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user