-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Defininando TTL no userDivicesCache igual usado no Baileys #1332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces a TTL for the No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @theeusmartins - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the cache configuration into a dedicated configuration file or section for better maintainability.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
private readonly userDevicesCache: CacheStore = new NodeCache({ | ||
stdTTL: 300000, | ||
useClones: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (bug_risk): Double-check stdTTL units for NodeCache.
NodeCache’s stdTTL option typically expects a time value in seconds. With the current value of 300000, ensure that the intended cache duration and unit are correct, so that the cache does not inadvertently persist data longer than expected.
Olá, como vai? Espero que você esteja bem. |
Oá amigo, esse 5 minutos está definido na baileys, essa parte do código é referente a conexão via baileys link do comando: https://github.com/WhiskeySockets/Baileys/blob/f19ffa7cca270d3b17bb04a019f68678ce1faca5/src/Socket/messages-send.ts#L37 |
Eu sei, mas você colocou Estou testando, mas continua a mesma coisa, para mim é outra coisa. |
Ajuste o lint por favor, estava para a branch |
No Canal de Comunição da Evolution com a Baileys, está definido como readonly e sem TTL o userDevicesCache, defini o TTL igual na Baileys.
Pois quando o Usuário reinstala o WhatsApp ( por diversos motivos ) ele refaz a criptografia do número e por esse cache não ter o TTL, para esses usuários fica "Aguardando mensagem. Essa ação pode levar alguns instantes"
Imagem do código no Baileys

Summary by Sourcery
Enhancements: