Skip to content
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

Define options to refresh database connections via keep alive and pool #56

Merged
merged 2 commits into from
Oct 14, 2023

Conversation

gilsondev
Copy link
Owner

Descrição

Este pull request tem como objetivo buscar meios de resolver o erro abaixo que periodicamente acontece:

(psycopg2.OperationalError) server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.

Parte disso pode ser característica do ambiente do fly.io, em que depois de um tempo o banco entra no "modo sleep" além da aplicação backend, perdendo a conexão e não fazendo um double check na sessão.

Alterações realizadas

  • api/src/core/database.py: Define parâmetros de pool de conexão
  • lib/database.py: Define parâmetros de keepalive

Contexto adicional

  • [Mencionar qualquer contexto adicional relevante para entender as alterações]

Issues relacionadas

Checklist

  • Os testes foram executados e passaram com sucesso
  • A documentação foi atualizada, se necessário
  • O código segue as diretrizes de estilo do projeto
  • Foram adicionados testes automatizados para as novas funcionalidades ou correções

@gilsondev gilsondev self-assigned this Oct 14, 2023
@vercel
Copy link

vercel bot commented Oct 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
checkstatus-govbr ✅ Ready (Inspect) Visit Preview Oct 14, 2023 1:31pm

@gilsondev gilsondev added devops Issues relacionados a infraestrutura do projeto backend:pipeline Issues relacionados ao módulo de pipeline backend:api Issues relacionados ao módulo de api backend:scheduler Issues relacionadas ao módulo scheduler labels Oct 14, 2023
@gilsondev gilsondev merged commit f83c45e into main Oct 14, 2023
@gilsondev gilsondev deleted the issue-37 branch October 14, 2023 13:31
@sentry-io
Copy link

sentry-io bot commented Oct 14, 2023

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ OperationalError: invalid integer value "Developer123localhost:5432" for connection option "port" lib.database in create_connection View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:api Issues relacionados ao módulo de api backend:pipeline Issues relacionados ao módulo de pipeline backend:scheduler Issues relacionadas ao módulo scheduler devops Issues relacionados a infraestrutura do projeto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant