mirror of
https://github.com/docusealco/docuseal
synced 2026-11-08 07:42:32 -05:00
retry webhooks in test mode
This commit is contained in:
1 parent
45ae954c0c
commit
01dd3fefe5
12 files changed
+80
-90
No files matched your search
@@ -3,13 +3,14 @@
|
||||
<% webhook_attempts = webhook_event.webhook_attempts.sort_by { |e| -e.id } %>
|
||||
<% if webhook_event.status == 'error' %>
|
||||
<% last_attempt = webhook_attempts.select { |e| e.attempt < SendWebhookRequest::MANUAL_ATTEMPT }.max_by(&:attempt) %>
|
||||
<% if webhook_event.webhook_attempts.none?(&:success?) && last_attempt.attempt <= 10 %>
|
||||
<% next_attempt_at = last_attempt.created_at + (2**last_attempt.attempt).minutes %>
|
||||
<% if webhook_event.webhook_attempts.none?(&:success?) && last_attempt.attempt <= 10 && next_attempt_at > 30.seconds.ago %>
|
||||
<li class="ml-7">
|
||||
<span class="btn btn-outline btn-xs btn-circle pointer-events-none absolute justify-center border-base-content-/60 text-base-content/60 bg-base-100" style="left: -12px;">
|
||||
<%= svg_icon('clock', class: 'w-4 h-4 shrink-0') %>
|
||||
</span>
|
||||
<p class="leading-none text-base-content/90 pt-1">
|
||||
<%= t('next_attempt_in_time_in_words', time_in_words: distance_of_time_in_words(Time.current, last_attempt.created_at + (2**last_attempt.attempt).minutes)) %>
|
||||
<%= t('next_attempt_in_time_in_words', time_in_words: distance_of_time_in_words(Time.current, next_attempt_at)) %>
|
||||
</p>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
Reference in new issue
Block a user