Skip to content

Commit

Permalink
fix: Avoid permanent cache for WPP.contact.queryExists (wppconnect-te…
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Mar 29, 2023
1 parent f54cc87 commit 556a97f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/contact/functions/queryExists.ts
Expand Up @@ -107,5 +107,11 @@ export async function queryExists(

cache.set(id, result);

// Delete from cache after 5min is success or 15s for failure
const timeout = result ? 300000 : 15000;
setTimeout(() => {
cache.delete(id);
}, timeout);

return result;
}

0 comments on commit 556a97f

Please sign in to comment.