-
-
Notifications
You must be signed in to change notification settings - Fork 5
Description
During a recent review of the Notion synchronization in the production environment, we encountered connection errors related to the PostgreSQL database. These issues appear to stem from how shared storage is currently handled in the BAS component. Specifically, a new database connection is being established for every insertion, which is inefficient and can lead to connection exhaustion or timeouts.
This task involves refactoring the current implementation to reuse a single persistent PostgreSQL connection (or use a connection pool if applicable) instead of creating a new one for each operation. The goal is to improve performance, reduce resource usage, and avoid future connection-related errors in the synchronization process.
The new implementation should aim to be compatible with the existing codebase, minimizing the need for refactoring across all current implementations that rely on the shared storage logic.