fix: prevent duplicate uploads and group asset commits

This commit is contained in:
Tom Boullay
2026-04-24 16:58:49 +02:00
parent fe8a6f0f54
commit 53c4c0ed60
15 changed files with 329 additions and 152 deletions
+16
View File
@@ -0,0 +1,16 @@
const activeUploads = new Set<string>()
function buildKey(folderName: string) {
return folderName.toLowerCase()
}
export function acquireUploadLock(folderName: string): boolean {
const key = buildKey(folderName)
if (activeUploads.has(key)) return false
activeUploads.add(key)
return true
}
export function releaseUploadLock(folderName: string) {
activeUploads.delete(buildKey(folderName))
}