Files
twenty/packages
Sonarly Claude Code 964249b7b0 fix: prevent DB connection timeout during long-running external API calls
https://sonarly.com/issue/36017?type=bug

Background worker's PostgreSQL connection becomes stale during 30+ second Gmail API batch fetch operations, causing "Connection terminated unexpectedly" when subsequent database queries execute.

Fix: **Fix: Enable TCP keepalives on PostgreSQL connections**

Added TCP keepalive settings to all database connection configurations:
- `keepAlive: true` - enables TCP keepalive probes
- `keepAliveInitialDelayMillis: 10000` - sends first probe after 10 seconds of idle time

This prevents AWS load balancers/RDS proxy from terminating idle connections during long-running external API operations (like Gmail batch fetches that take 30+ seconds).

Files changed for the fix:
1. `global-workspace-datasource.service.ts` - primary and replica datasource configurations
2. `core.datasource.ts` - core datasource configuration

Both locations now have consistent keepalive settings that will maintain TCP connections through infrastructure idle timeouts.
2026-05-08 02:15:45 +00:00
..
2026-05-04 11:09:34 +02:00
2026-05-07 20:47:07 +02:00