Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send server restart notification for listening sesions too #1785

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading