retry webhooks in test mode

This commit is contained in:
Pete Matsyburka
2026-05-06 19:09:35 +03:00
parent 45ae954c0c
commit 01dd3fefe5
12 changed files with 80 additions and 90 deletions
@@ -28,13 +28,12 @@ class SendFormStartedWebhookRequestJob
attempt:,
data: Submitters::SerializeForWebhook.call(submitter))
if (resp.nil? || resp.status.to_i >= 400) && attempt <= MAX_ATTEMPTS &&
(!Docuseal.multitenant? || submitter.account.account_configs.exists?(key: :plan))
SendFormStartedWebhookRequestJob.perform_in((2**attempt).minutes, {
**params,
'attempt' => attempt + 1,
'last_status' => resp&.status.to_i
})
end
return if attempt > MAX_ATTEMPTS || (resp && resp.status.to_i < 400)
SendFormStartedWebhookRequestJob.perform_in((2**attempt).minutes, {
**params,
'attempt' => attempt + 1,
'last_status' => resp&.status.to_i
})
end
end