mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 09:03:19 +08:00
Fix: Tag deletion timeout issue
- Change cache purging from synchronous to asynchronous - Prevents "Delete Failed" false positives when Cloudflare API is slow - Tags are now deleted immediately while cache purges in background - Uses waitUntil() for non-blocking cache operations
This commit is contained in:
@@ -168,9 +168,9 @@ async function handleUpdateTags(context, db, fileId, hostname) {
|
||||
metadata: fileData.metadata
|
||||
});
|
||||
|
||||
// Clear CDN cache
|
||||
// Clear CDN cache asynchronously (don't wait for it to complete)
|
||||
const cdnUrl = `https://${hostname}/file/${fileId}`;
|
||||
await purgeCFCache(context.env, cdnUrl);
|
||||
waitUntil(purgeCFCache(context.env, cdnUrl));
|
||||
|
||||
// Update file index asynchronously
|
||||
waitUntil(addFileToIndex(context, fileId, fileData.metadata));
|
||||
|
||||
Reference in New Issue
Block a user