diff --git a/backend/src/plugins/Mutes.ts b/backend/src/plugins/Mutes.ts index a5df9e09..aafb510e 100644 --- a/backend/src/plugins/Mutes.ts +++ b/backend/src/plugins/Mutes.ts @@ -150,8 +150,11 @@ export class MutesPlugin extends ZeppelinPlugin { reason: string = null, muteOptions: MuteOptions = {}, ): Promise { + const lock = await this.locks.acquire(`mute-${userId}`); + const muteRole = this.getConfig().mute_role; if (!muteRole) { + lock.unlock(); this.throwRecoverablePluginError(ERRORS.NO_MUTE_ROLE_IN_CONFIG); } @@ -287,6 +290,8 @@ export class MutesPlugin extends ZeppelinPlugin { }); } + lock.unlock(); + return { case: theCase, notifyResult,