fix: retry interval

This commit is contained in:
2026-04-08 13:37:24 +04:00
parent 587442d034
commit 9425fb2454
5 changed files with 30 additions and 13 deletions
+2 -2
View File
@@ -525,7 +525,7 @@ export const dashboard = new Elysia()
max_retries: Number(b.max_retries) || 0,
retry_interval_s: Number(b.retry_interval_s) || 30,
resend_interval: Number(b.resend_interval) || 0,
cert_alert_days: b.cert_alert_days != null ? Number(b.cert_alert_days) : 14,
cert_alert_days: b.cert_alert_days != null ? Number(b.cert_alert_days) : 0,
channel_ids: Array.isArray(b.channel_ids) ? b.channel_ids : (b.channel_ids ? [b.channel_ids] : []),
regions,
request_headers: Object.keys(requestHeaders).length ? requestHeaders : null,
@@ -567,7 +567,7 @@ export const dashboard = new Elysia()
max_retries: Number(b.max_retries) || 0,
retry_interval_s: Number(b.retry_interval_s) || 30,
resend_interval: Number(b.resend_interval) || 0,
cert_alert_days: b.cert_alert_days != null ? Number(b.cert_alert_days) : 14,
cert_alert_days: b.cert_alert_days != null ? Number(b.cert_alert_days) : 0,
channel_ids: Array.isArray(b.channel_ids) ? b.channel_ids : (b.channel_ids ? [b.channel_ids] : []),
regions,
request_headers: Object.keys(requestHeaders).length ? requestHeaders : null,
+2 -2
View File
@@ -162,7 +162,7 @@
<span class="k">"max_retries"</span>: <span class="n">2</span>, <span class="c">// optional — retry N times before declaring DOWN. Default: 0</span>
<span class="k">"retry_interval_s"</span>: <span class="n">30</span>, <span class="c">// optional — seconds between retries. Default: 30</span>
<span class="k">"resend_interval"</span>: <span class="n">10</span>, <span class="c">// optional — re-alert every Nth consecutive DOWN beat. 0 = never. Default: 0</span>
<span class="k">"cert_alert_days"</span>: <span class="n">14</span>, <span class="c">// optional — alert when TLS cert is within N days of expiry. 0 disables. Default: 14</span>
<span class="k">"cert_alert_days"</span>: <span class="n">0</span>, <span class="c">// optional — alert when TLS cert is within N days of expiry. 0 disables. Default: 0 (disabled)</span>
<span class="k">"channel_ids"</span>: [<span class="s">"&lt;uuid&gt;"</span>], <span class="c">// optional — notification channels to attach</span>
<span class="k">"query"</span>: { ... } <span class="c">// optional — see Query Language below</span>
}</pre>
@@ -181,7 +181,7 @@
<tr><td>max_retries</td><td>number</td><td>Retry a failing check this many times before posting a DOWN result. Default: 0. Max: 10. See <a href="#reliability">Reliability</a>.</td></tr>
<tr><td>retry_interval_s</td><td>number</td><td>Seconds between retries. Default: 30.</td></tr>
<tr><td>resend_interval</td><td>number</td><td>If a monitor stays DOWN, re-fire a notification every Nth consecutive down beat. 0 disables resend. Default: 0.</td></tr>
<tr><td>cert_alert_days</td><td>number</td><td>Fire a separate <code>cert</code> notification when the TLS certificate is within N days of expiring. 0 disables. Default: 14.</td></tr>
<tr><td>cert_alert_days</td><td>number</td><td>Fire a separate <code>cert</code> notification when the TLS certificate is within N days of expiring. 0 disables. Default: 0 (disabled).</td></tr>
<tr><td>channel_ids</td><td>string[]</td><td>Notification channel IDs to attach. See <a href="#notifications">Notifications</a>.</td></tr>
<tr><td>query</td><td>object</td><td>Query conditions — see below</td></tr>
</tbody>
+10 -5
View File
@@ -94,12 +94,19 @@
<% }) %>
</select>
</div>
<%
const allRetryGaps = [['5','5 seconds'],['15','15 seconds'],['30','30 seconds'],['60','1 minute'],['120','2 minutes'],['300','5 minutes']];
const retryGaps = allRetryGaps.filter(([val]) => Number(val) >= minInterval);
const defaultRetryGap = String(Math.max(30, minInterval));
const curRetryRaw = Number(monitor.retry_interval_s);
const curRetry = (curRetryRaw >= minInterval) ? String(curRetryRaw) : defaultRetryGap;
%>
<div class="flex-1">
<label class="block text-sm text-gray-400 mb-1.5">Retry gap</label>
<select id="<%= prefix %>retry-interval" name="retry_interval_s"
class="w-full <%= bg %> border <%= border %> rounded-lg px-4 py-2.5 text-gray-100 focus:outline-none focus:border-blue-500">
<% [['5','5 seconds'],['15','15 seconds'],['30','30 seconds'],['60','1 minute'],['120','2 minutes']].forEach(function([val, label]) { %>
<option value="<%= val %>" <%= String(monitor.retry_interval_s ?? '30') === val ? 'selected' : '' %>><%= label %></option>
<% retryGaps.forEach(function([val, label]) { %>
<option value="<%= val %>" <%= curRetry === val ? 'selected' : '' %>><%= label %></option>
<% }) %>
</select>
</div>
@@ -116,9 +123,7 @@
<%
const certDaysRaw = Number(monitor.cert_alert_days);
const certDaysSel = certDaysRaw === 0 ? '0'
: (certDaysRaw >= 1 && certDaysRaw <= 9) ? String(certDaysRaw)
: '7';
const certDaysSel = (certDaysRaw >= 1 && certDaysRaw <= 9) ? String(certDaysRaw) : '0';
%>
<div>
<label class="block text-sm text-gray-400 mb-1.5">TLS cert expiry alert</label>