Mrtenz / typeorm-store

A TypeORM-based store for express-session.
MIT License
16 stars 12 forks source link

Fix a discrepancy in the expirationInterval #6

Closed RoccoC closed 3 years ago

RoccoC commented 3 years ago

The expirationInterval config option is actually set in milliseconds, despite the doc comment indicating that it is in seconds. This is a pretty significant discrepancy: supplying an expirationInterval of 60 would result in a DB call every 60 milliseconds, not every 60 seconds as expected.

This PR updates the expiration logic to behave as documented by updating the interval passed to the setInterval function.

Since this change would significantly alter expiration intervals in the wild, I opted to bump a full major version.

RoccoC commented 3 years ago

Whoops, just saw there's already a PR for this issue: https://github.com/Mrtenz/typeorm-store/pull/4