Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-6460 Remove redis-node package #3435

Merged
merged 5 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const morgan = require('morgan');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const compression = require('compression');
const redis = require('redis');
const Redis = require('ioredis');
const RedisStore = require('connect-redis').default;
const session = require('express-session');
const methodOverride = require('method-override');
Expand Down Expand Up @@ -123,10 +123,7 @@ let sessionStore;
const redisUrl = REDIS_URI;
if (redisUrl) {
logger.info(`Using Redis session store at '${redisUrl}'.`);
const client = redis.createClient({
url: redisUrl,
});
client.connect().catch((err) => logger.error(err));
const client = new Redis(redisUrl);

// The error event must be handled, otherwise the app crashes on redis connection errors.
// This is due to basic NodeJS behavior: https://nodejs.org/api/events.html#error-events
Expand Down Expand Up @@ -211,7 +208,6 @@ app.use(methodOverride((req, res, next) => { // for POST requests
app.use(require('./middleware/i18n'));
app.use(require('./middleware/datetime'));


const redirectUrl = Configuration.get('ROOT_URL_REDIRECT');
if (redirectUrl !== '') {
app.get('/', (req, res, next) => {
Expand Down
Loading
Loading