voxpelli / node-connect-pg-simple

A simple, minimal PostgreSQL session store for Express
https://www.npmjs.com/package/connect-pg-simple
MIT License
234 stars 74 forks source link

If at the first try to create the session table the database is down, the store fails forever #268

Closed bk-jb closed 1 year ago

bk-jb commented 1 year ago

Because the tableCreationPromise Promise does not care for success, the failing one is kept forever and the store will not recover.

Some may consider it an edge case, but I find it problematic for use in cloud services, as it is not always 100% sure that database containers spawn before the node container a web page/service using this lib is running on. This is where I stumbled over this issue. It would be nice to be reliably able to spawn containers no matter whether the database is there already.

bk-jb commented 1 year ago

I have created a pull request for a patch I have tested, #269

voxpelli commented 1 year ago

Thanks for the PR! I have proposed an alternative fix that should avoid this issue ever occurring: https://github.com/voxpelli/node-connect-pg-simple/pull/285

voxpelli commented 1 year ago

Closing in favor of merged #285, thanks for the PR though and sorry for the lack of attention from me!