-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[FIX] Sistema de webhooks: melhoria com timeout e retentativas configuráveis #1326
[FIX] Sistema de webhooks: melhoria com timeout e retentativas configuráveis #1326
Conversation
Adiciona interface de configuração na estrutura Webhook para permitir: - Configuração de timeout em requisições - Parâmetros de retentativas configuráveis - Lista de códigos HTTP que não devem gerar retry Issue: EvolutionAPI#1325
Adiciona novas variáveis para controlar o comportamento dos webhooks: - WEBHOOK_REQUEST_TIMEOUT_MS: tempo máximo de espera - WEBHOOK_RETRY_MAX_ATTEMPTS: número máximo de tentativas - WEBHOOK_RETRY_INITIAL_DELAY_SECONDS: intervalo inicial - WEBHOOK_RETRY_USE_EXPONENTIAL_BACKOFF: ativar backoff exponencial - WEBHOOK_RETRY_MAX_DELAY_SECONDS: intervalo máximo entre tentativas - WEBHOOK_RETRY_JITTER_FACTOR: fator de aleatoriedade - WEBHOOK_RETRY_NON_RETRYABLE_STATUS_CODES: códigos de erro permanentes Issue: EvolutionAPI#1325
Implementa timeout configurável nas requisições de webhook: - Aplica configuração em todas as instâncias axios - Usa valor padrão de 30 segundos se não configurado - Evita requisições penduradas indefinidamente Issue: EvolutionAPI#1325
Reviewer's Guide by SourceryThis pull request introduces significant enhancements to the webhook system, including configurable timeout and retry mechanisms with exponential backoff and jitter. It also fixes a critical bug that caused duplicate webhooks. The changes are implemented by adding new environment variables for configuration, modifying the webhook request logic to include timeout and retry functionality, and updating the configuration service to support the new settings. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Assessment against linked issues
Possibly linked issues
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 @guilhermejansen - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a circuit breaker to prevent cascading failures and improve system resilience.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 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.
libera isso pra noooooois To com muitos erros de WEBHOOK via API, principalmente via DIFY , que quando da algum erro ou demora mais de 30s a conversa simplesmente TRAVA e só deletando a sessão pro bot voltar a funcionar. |
faz um fork e cria uma imagem amigo. |
up |
UP |
Up!! |
Ajuste os conflitos por favor, estava para a branch |
#1341 corrigido, obrigado @DavidsonGomes ! |
Referência
Resolve #1325
Descrição
Esta PR implementa melhorias significativas no sistema de webhooks da API, adicionando configurabilidade via variáveis de ambiente e corrigindo o bug crítico que causava duplicação de webhooks.
Problemas Resolvidos
Novas Configurações
Todas estas configurações são opcionais e possuem valores padrão razoáveis:
Impacto e Compatibilidade
Testes Realizados
Alterações Implementadas
Summary by Sourcery
Improves the webhook system by adding configurable options for timeout and retry logic, and fixes a bug that caused duplicate webhooks. It introduces environment variables to configure the webhook system.
Bug Fixes:
Enhancements: