From 7228d4b7638a99e48c2c7fb8dfa39ee5ffd9db24 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Tue, 5 Aug 2025 19:49:14 +0200 Subject: [PATCH] fix(webhooks): extend timeout for webhook retries to 15 minutes Increase the timeout duration in the retryFailedWebhook function from 30 seconds to 15 minutes to accommodate longer processing times for webhook retries. This change aims to improve the reliability of the retry mechanism. --- retry_failed_webhooks.js | 2 +- x.js | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/retry_failed_webhooks.js b/retry_failed_webhooks.js index 970b7e5..2ade3bb 100755 --- a/retry_failed_webhooks.js +++ b/retry_failed_webhooks.js @@ -24,7 +24,7 @@ async function retryFailedWebhook(filepath) { headers: { 'Content-Type': 'application/json' }, - timeout: 30000 + timeout: 900000 // 15 minutes }); console.log(`✅ Retry successful: ${response.status}`); diff --git a/x.js b/x.js index 09171f5..7800adf 100644 --- a/x.js +++ b/x.js @@ -343,12 +343,13 @@ function formatCommitMessage(payload) { // Telegram MarkdownV2 reserved characters (in text contexts) .replace(/([_*[\]()~`>#+\-=|{}.!])/g, '\\$1'); }; - // Escaper for inline code content inside backticks: only escape backticks and backslash + // Escaper for inline code content inside backticks: escape backticks, backslash, and periods const escapeInlineCode = (s) => { if (s == null) return ''; return String(s) .replace(/\\/g, '\\\\') - .replace(/`/g, '\\`'); + .replace(/`/g, '\\`') + .replace(/\./g, '\\.'); }; commits.forEach((commit) => { @@ -377,7 +378,7 @@ function formatCommitMessage(payload) { filesList += ` • \`${escapeInlineCode(file)}\`\n`; }); if (allAdded.size > 10) { - filesList += ` • ... and ${allAdded.size - 10} more\n`; + filesList += ` • ${escapeMdV2(`... and ${allAdded.size - 10} more`)}\n`; } } @@ -387,7 +388,7 @@ function formatCommitMessage(payload) { filesList += ` • \`${escapeInlineCode(file)}\`\n`; }); if (allModified.size > 10) { - filesList += ` • ... and ${allModified.size - 10} more\n`; + filesList += ` • ${escapeMdV2(`... and ${allModified.size - 10} more`)}\n`; } } @@ -397,7 +398,7 @@ function formatCommitMessage(payload) { filesList += ` • \`${escapeInlineCode(file)}\`\n`; }); if (allRemoved.size > 10) { - filesList += ` • ... and ${allRemoved.size - 10} more\n`; + filesList += ` • ${escapeMdV2(`... and ${allRemoved.size - 10} more`)}\n`; } }