Enforce unified lock names by using functions to generate lock keys (#165)
This commit is contained in:
parent
fcbb25b7ff
commit
c5d68650a3
18 changed files with 70 additions and 28 deletions
|
@ -1,6 +1,7 @@
|
|||
import { mutesEvt } from "../types";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars } from "../../../utils";
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers";
|
||||
|
||||
/**
|
||||
* Reapply active mutes on join
|
||||
|
@ -11,9 +12,9 @@ export const ReapplyActiveMuteOnJoinEvt = mutesEvt("guildMemberAdd", async ({ pl
|
|||
const muteRole = pluginData.config.get().mute_role;
|
||||
|
||||
if (muteRole) {
|
||||
const memberRolesLock = await pluginData.locks.acquire(`member-roles-${member.id}`);
|
||||
const memberRoleLock = await pluginData.locks.acquire(memberRolesLock(member));
|
||||
await member.addRole(muteRole);
|
||||
memberRolesLock.unlock();
|
||||
memberRoleLock.unlock();
|
||||
}
|
||||
|
||||
pluginData.state.serverLogs.log(LogType.MEMBER_MUTE_REJOIN, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue