3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-06-16 02:55:03 +00:00

Fix permanent mutes being removed immediately as if they expired

This commit is contained in:
Dragory 2021-09-26 09:47:14 +03:00
parent 2e9445ce35
commit 58e69a19a3
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
5 changed files with 13 additions and 5 deletions

View file

@ -52,8 +52,12 @@ export async function runExpiringMutesLoop() {
export function registerExpiringMute(mute: Mute) {
clearExpiringMute(mute);
if (mute.expires_at === null) {
return;
}
console.log("[EXPIRING MUTES LOOP] Registering new expiring mute");
const remaining = Math.max(0, moment.utc(mute.expires_at!).diff(moment.utc()));
const remaining = Math.max(0, moment.utc(mute.expires_at).diff(moment.utc()));
if (remaining > LOOP_INTERVAL) {
return;
}