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

Redis down fix #2277

Merged
merged 4 commits into from
Oct 2, 2014
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
sometimes when running the tests we will fail because we haven't set …
…the session state yet, this fixes that
Chuwiey committed Oct 1, 2014
commit 63b4fb2a5f6759995a90d97b05d8dbea1f649cee
11 changes: 6 additions & 5 deletions lib/hooks/http/initialize.js
Original file line number Diff line number Diff line change
@@ -97,12 +97,13 @@ module.exports = function(sails) {
});

// in case Redis session store fails, return 500 immediately
// if session isn't already set, assume it's ok
app.use(function (req, res, next) {
if (!sails.config.session.state) {
sails.log.error('Session store fail');
return res.send(500); // handle error
}
return next();
if (sails.config.session.state === false) {
sails.log.error('Session store fail');
return res.send(500); // handle error
}
return next();
});

// When Sails is ready, start the express server