Skip to content

Commit bfb9205

Browse files
author
Joan Reyero
authored
Bug fix: SQL alchemy connection problem in Kubernetes (#72)
1 parent 2ea0c34 commit bfb9205

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

backend/src/serverless/integrations/iterators/baseIterator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default abstract class BaseIterator {
140140
console.log('State: ', this.state)
141141
console.log('Response length: ', response.records.length)
142142
console.log('Limit', response.limit)
143-
console.log('Last record: ', parseOutput.lastRecord)
143+
// console.log('Last record: ', parseOutput.lastRecord)
144144
console.log('Time since start: ', timeSinceStart)
145145
console.log('Count towards limit: ', this.limitCount, ' / ', this.globalLimit)
146146
}

backend/src/serverless/microservices/python/crowd-backend/crowd/backend/repository/repository.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ def __init__(self, tenant_id="", db_url=False, test=False, send=True):
6161
self.db_url = f'postgresql://{username}:{password}@{host}/{database}'
6262

6363
self.engine = create_engine(
64-
self.db_url, echo=False, execution_options={"postgresql_readonly": True, "postgresql_deferrable": True}
64+
self.db_url, pool_pre_ping=True, echo=False, execution_options={"postgresql_readonly": True, "postgresql_deferrable": True},
65+
connect_args={
66+
"keepalives": 1,
67+
"keepalives_idle": 30,
68+
"keepalives_interval": 10,
69+
"keepalives_count": 5,
70+
}
6571
)
6672

6773
Base.metadata.create_all(self.engine, checkfirst=True)

0 commit comments

Comments
 (0)