Skip to content

Conversation

themarolt
Copy link
Contributor

@themarolt themarolt commented Jun 5, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 609f94a

Improved the performance and maintenance of the database by adjusting the connection pool options and adding a function to delete old audit logs. The function cleanUpOldAuditLogs in auditLogRepository.ts uses raw SQL queries and a parameter for the log retention period.

🤖 Generated by Copilot at 609f94a

The pool is drowning, the queries are slow
We need to optimize, we need to let go
cleanUpOldAuditLogs, purge the ancient sins
With raw SQL power, we make the database spin

Why

How

🤖 Generated by Copilot at 609f94a

  • Reduce database connection pool size and increase connection timeout to improve performance (link)
  • Import QueryTypes enum from Sequelize to enable raw SQL queries (link)
  • Add cleanUpOldAuditLogs function to auditLogRepository to delete old audit logs (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@joanreyero joanreyero self-requested a review June 5, 2023 18:15
@themarolt themarolt merged commit 46dc4bd into main Jun 6, 2023
@themarolt themarolt deleted the enhancement/db-pool-size-optimization-and-auditLog-cleanup-job branch June 6, 2023 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants