Skip to content

Commit

Permalink
Send server restart notification for listening sesions too (#1785)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brainicism authored Dec 10, 2023
1 parent bb99cc0 commit ab91bf9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/helpers/management_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,28 @@ export async function warnServersImpendingRestart(
): Promise<void> {
let serversWarned = 0;
if (RESTART_WARNING_INTERVALS.has(timeUntilRestart)) {
for (const gameSession of Object.values(State.gameSessions)) {
if (gameSession.finished) continue;
for (const session of [
...Object.values(State.gameSessions),
...Object.values(State.listeningSessions),
]) {
if (session.finished) continue;
// eslint-disable-next-line no-await-in-loop
await sendInfoMessage(
new MessageContext(
gameSession.textChannelID,
session.textChannelID,
null,
gameSession.guildID,
session.guildID,
),
{
title: i18n.translate(
gameSession.guildID,
session.guildID,
"misc.restart.title",
{
timeUntilRestart: String(timeUntilRestart),
},
),
description: i18n.translate(
gameSession.guildID,
session.guildID,
"misc.restart.description_hard",
{
downtimeMinutes: String(5),
Expand Down

0 comments on commit ab91bf9

Please sign in to comment.