voxpelli/node-connect-pg-simple

Set pruneSessionInterval to false if running N server instances?

alfonmga opened this issue · 1 comments

Should I turn off pruneSessionInterval option if I'm running multiple server instances? or should I not worry about this?

Wouldn't this query run multiple times (N server instances) if I let it enabled?

this.query('DELETE FROM ' + this.quotedTable() + ' WHERE expire < to_timestamp($1)', [currentTimestamp()], err => {

A cronjob should be the way to go so?

Thanks!

I just remembered that my server will run on Google Cloud Run and as it is a serverless execution environment setTimeouts and setIntervals will not work so it doesn't matter in my scenario.

I'm forced to go the cronjob way to prune all expired sessions.