Agus
Agus
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Seems like that did the trick
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
We just deployed it so I will come back to you in a few hours
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Straight up pool.min: 0 as you said In my config/database.ts
// My other imports

const databaseConfig: DatabaseConfig = {
connections: {
pg: {
/// Rest of my config
pool: {
min: 0,
}
}
};
// My other imports

const databaseConfig: DatabaseConfig = {
connections: {
pg: {
/// Rest of my config
pool: {
min: 0,
}
}
};
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Yeah, its on the basic pool config
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
I totally agree on this one, awesome thank you!
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Aaand it has knex declared as a dependency
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Thanks!
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Will try that, with the info that the db doesn't drop the connection narrows my problem
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
I'm just digging into this problem so I'm not discarding the posibility of the framework being at fault
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
Are you able to connect to the db externally when this happens?
Yeah, the app eventually re-connects after we try to perform 1 request,
Are you pooling connections/prematurely releasing them ahead of next query?
I'll have to do some digging because we are using a ORM to handle queries
Can you elaborate on what "drops the connection" mean here? What error are you seeing from your application? ^ anything in your database logs on Railway (database -> Logs tab) that would suggest it's dropping connections within similar timestamp ranges?
{"level":40,"time":1692989569205,"pid":20,"hostname":"railway","name":"axer-backend","msg":"Connection Error: Connection ended unexpectedly"}
{"level":40,"time":1692989569205,"pid":20,"hostname":"railway","name":"axer-backend","msg":"Connection Error: Connection ended unexpectedly"}
26 replies
RRailway
Created by Agus on 8/25/2023 in #✋|help
Postgres drops connection when inactive, is this by default?
54c2ba8f-05f3-48a7-8347-7fe20afe05a8
26 replies