fix(create): prevent duplicate rapid submissions

This commit is contained in:
hzw
2026-09-18 23:13:32 +08:00
parent 9eb2fcd453
commit 878bd35cf4
3 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
export function createCreationSubmitGate() {
let locked = false;
return {
tryAcquire() {
if (locked) return false;
locked = true;
return true;
},
release() {
locked = false;
},
};
}