From 16392cb8deb9269323e7048fbda3576454fc11e4 Mon Sep 17 00:00:00 2001 From: Erik Zuuring Date: Thu, 14 Nov 2024 15:57:54 +0200 Subject: [PATCH 1/2] Change thread async duration ### Notes Let's bump the check between messages to be 12 hours instead of 60 minutes. --- discord-scripts/thread-management/check-thread-archiving.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord-scripts/thread-management/check-thread-archiving.ts b/discord-scripts/thread-management/check-thread-archiving.ts index f7bc0250..e9d3e9d7 100644 --- a/discord-scripts/thread-management/check-thread-archiving.ts +++ b/discord-scripts/thread-management/check-thread-archiving.ts @@ -31,7 +31,7 @@ import { // The maximum time between any two messages after which a thread is considered // async. -const MAX_HEURISTIC_SYNC_THREAD_DURATION = 60 * MINUTE // 60 * MINUTE +const MAX_HEURISTIC_SYNC_THREAD_DURATION = 12 * HOUR // 60 * MINUTE // How frequently threads are checked for archive requirements. const THREAD_CHECK_CADENCE = 12 * HOUR // 12 * HOUR // Use a ThreadAutoArchiveDuration as we'll still lean on Discord to From 942bb404e58ca24e3cd10efa6d1fe106ff011e99 Mon Sep 17 00:00:00 2001 From: Erik Zuuring Date: Thu, 14 Nov 2024 20:20:19 +0200 Subject: [PATCH 2/2] Change time send on AUTO_ARCHIVE call --- discord-scripts/thread-management/check-thread-archiving.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/discord-scripts/thread-management/check-thread-archiving.ts b/discord-scripts/thread-management/check-thread-archiving.ts index e9d3e9d7..a24ec944 100644 --- a/discord-scripts/thread-management/check-thread-archiving.ts +++ b/discord-scripts/thread-management/check-thread-archiving.ts @@ -368,9 +368,7 @@ async function checkThreadStatus( if ( lastActiveTimestamp - (firstActiveTimestamp ?? 0) > (thread.autoArchiveDuration ?? 0) * MINUTE - - /* AUTO_ARCHIVE_WARNING_LEAD_MINUTES */ (thread.autoArchiveDuration ?? - 0) * - MINUTE + AUTO_ARCHIVE_WARNING_LEAD_MINUTES * MINUTE ) { await thread.send({ content: