From 0b816867240286e21b4d85cd9347ed971a09ff70 Mon Sep 17 00:00:00 2001 From: Madeline <1500092+AverageHelper@users.noreply.github.com> Date: Wed, 14 Feb 2024 11:39:12 -0700 Subject: [PATCH] feat: Mention the cooldown timer's start point in internal logs (#124) --- CHANGELOG.md | 1 + src/actions/queue/processSongRequest.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8963dc5a..dacbd75d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Internal logging to indicate the start of a user's submission cooldown timer. - `.mailmap` file. ### Changed diff --git a/src/actions/queue/processSongRequest.ts b/src/actions/queue/processSongRequest.ts index 125b9878..7c698412 100644 --- a/src/actions/queue/processSongRequest.ts +++ b/src/actions/queue/processSongRequest.ts @@ -106,8 +106,12 @@ async function acceptSongRequest({ logger }: SongAcceptance): Promise { logger.debug(`Began enqueuing request at ${Date.now()} from ${logUser(context.user)}`); - await pushEntryToQueue(entry, queueChannel); - logger.debug(`Enqueued request at ${Date.now()} from ${logUser(context.user)}`); + const storedEntry = await pushEntryToQueue(entry, queueChannel); + logger.debug( + `Enqueued request at ${Date.now()} from ${logUser( + context.user + )}. Cooldown timer began at ${storedEntry.sentAt.getTime()}` + ); logger.verbose(`Accepted request from user ${logUser(context.user)}.`); logger.debug( `Pushed new request to queue. Sending public acceptance to user ${logUser(context.user)}`