Skip to content

Commit

Permalink
Merge pull request #1386 from kethinov/0.22.3
Browse files Browse the repository at this point in the history
0.22.3
  • Loading branch information
kethinov authored Apr 19, 2024
2 parents ea843a8 + 252ac78 commit 05fe643
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 117 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

## Next version

- Updated default session store to use sqlite.
- Updated ESLint.
- Put your changes here...

## 0.22.3

- Updated default session store to use SQLite instead of an in-memory database so that sessions are not invalidated when the server restarts.
- Updated various dependencies.

## 0.22.2

Expand Down
22 changes: 12 additions & 10 deletions lib/setExpressConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,19 @@ module.exports = function (app) {

if (params.expressSessionStore.instance) {
store = params.expressSessionStore.instance
} else if (params.expressSessionStore.preset === 'default') {
store = new SqliteStore({
client: new Sqlite(params.expressSessionStore.filename),
expired: {
clear: true,
intervalMs: params.expressSessionStore.presetOptions.checkPeriod
}
})
} else if (params.expressSessionStore.preset === 'express-session-default') {
} else {
if (params.mode === 'production-proxy' || (params.localhostOnly && !params.hostPublic)) logger.warn('Session store as-configured will only scale to one process. Read more about scaling sessions here: https://github.com/rooseveltframework/roosevelt#use-a-caching-service-or-a-database-to-store-sessions')
store = null
if (params.expressSessionStore.preset === 'default') {
store = new SqliteStore({
client: new Sqlite(params.expressSessionStore.filename),
expired: {
clear: true,
intervalMs: params.expressSessionStore.presetOptions.checkPeriod
}
})
} else if (params.expressSessionStore.preset === 'express-session-default') {
store = null
}
}

let sessionOptions
Expand Down
Loading

0 comments on commit 05fe643

Please sign in to comment.