Fix typeorm queries no longer allowing empty where clauses

This commit is contained in:
Emma [it/its]@Rory& 2025-07-02 17:36:46 +02:00 committed by Rory&
parent fca7953a51
commit 3e549dae28
2 changed files with 15 additions and 12 deletions

View File

@ -34,5 +34,5 @@ export async function initInstance() {
// }
// TODO: do no clear sessions for instance cluster
await Session.delete({});
await Session.clear();
}

View File

@ -49,15 +49,18 @@ export function generateStreamKey(
// TODO: remove this when Server.stop() is fixed so that it waits for all websocket connections to run their
// respective Close event listener function for session cleanup
export async function cleanupOnStartup(): Promise<void> {
await VoiceState.update(
{},
{
// @ts-expect-error channel_id is nullable
channel_id: null,
// @ts-expect-error guild_id is nullable
guild_id: null,
self_stream: false,
self_video: false,
},
);
// TODO: how is this different from clearing the table?
//await VoiceState.update(
// {},
// {
// // @ts-expect-error channel_id is nullable
// channel_id: null,
// // @ts-expect-error guild_id is nullable
// guild_id: null,
// self_stream: false,
// self_video: false,
// },
//);
await VoiceState.clear();
}