This commit is contained in:
payacom
2026-09-03 16:06:02 +03:30
parent 3f416a7a60
commit 90c5f94b57
31 changed files with 3968 additions and 4283 deletions

View File

@@ -48,7 +48,10 @@ async function invalidateCachePattern (pattern) {
for await (const key of redis.scanIterator({ MATCH: pattern, COUNT: 100 })) {
keys.push(key)
}
if (keys.length) await redis.del(keys)
// این کلاینتِ redis برای del چندکلیدی آرگومان‌های جدا می‌خواد، نه یه آرایه —
// پاس‌دادنِ مستقیمِ آرایه با خطای "arguments[1] must be of type string|Buffer"
// silently fail می‌شد و کشِ باطل‌نشده می‌موند
if (keys.length) await redis.del(...keys)
} catch (err) {
console.error(`[cache] pattern invalidate error for ${pattern}:`, err.message)
}