mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
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,4 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { counterIdLock } from "../../../utils/lockNameHelpers";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { checkCounterTrigger } from "./checkCounterTrigger";
|
||||
import { checkReverseCounterTrigger } from "./checkReverseCounterTrigger";
|
||||
|
@ -25,7 +26,7 @@ export async function setCounterValue(
|
|||
}
|
||||
|
||||
const counterId = pluginData.state.counterIds[counterName];
|
||||
const lock = await pluginData.locks.acquire(counterId.toString());
|
||||
const lock = await pluginData.locks.acquire(counterIdLock(counterId));
|
||||
|
||||
await pluginData.state.counters.setCounterValue(counterId, channelId, userId, value);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue