From 9868a728bff269e08fb82bc3cade4314f237e724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 4 Jun 2024 21:14:11 -0400 Subject: [PATCH] refactor: single cache.del call --- src/posts/parse.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/posts/parse.js b/src/posts/parse.js index 2b7d5081d4..e51128b6e4 100644 --- a/src/posts/parse.js +++ b/src/posts/parse.js @@ -72,9 +72,7 @@ module.exports = function (Posts) { Posts.clearCachedPost = function (pid) { const cache = require('./cache'); - allowedTypes.forEach((type) => { - cache.del(`${String(pid)}|${type}`); - }); + cache.del(allowedTypes.map(type => `${String(pid)}|${type}`)); }; Posts.parseSignature = async function (userData, uid) {