Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

issue #19735: Undo some linting that caused more problems than it solved

  • Loading branch information...
commit 74e2b77cdfa9880a04e121670d229610479aa05d 1 parent c8bf853
John Rogelstad authored
Showing with 5 additions and 7 deletions.
  1. +5 −7 node-datasource/oauth2/db/connect-xt-pg.js
View
12 node-datasource/oauth2/db/connect-xt-pg.js
@@ -46,8 +46,8 @@ module.exports = function (connect) {
options = options || {};
Store.call(this, options);
- this.prefix = null === options.prefix ? 'sess:' : options.prefix;
- this.hybridCache = null === options.hybridCache ? false : options.hybridCache;
+ this.prefix = null == options.prefix ? 'sess:' : options.prefix;
+ this.hybridCache = null == options.hybridCache ? false : options.hybridCache;
this.sessions = {};
// Load all the data from XM.SessionStore into the Express MemoryStore for caching.
@@ -238,8 +238,7 @@ module.exports = function (connect) {
try {
var fetchCache,
fetchDB,
- that = this,
- K = XM.Model;
+ that = this;
sid = this.prefix + sid;
sess = JSON.stringify(sess);
@@ -300,13 +299,12 @@ module.exports = function (connect) {
fetchOptions.id = sid;
fetchOptions.success = function (model, resp) {
- var status = model.getStatus();
// Fetch found this session, update it and save.
model.set("session", sess);
// Set gets called a lot. There isn't always a change to save and save will fail.
// Check if this model has changed before trying to save it.
- if (status === K.READY_CLEAN) {
+ if (model.getStatusString() === "READY_CLEAN") {
if (that.hybridCache) {
// MemoryStore did not have a matching session, update existing or add new.
MemoryStore.set(sid, JSON.parse(sess), function (err, cache) {
@@ -323,7 +321,7 @@ module.exports = function (connect) {
// Nothing to save, move along.
done && done();
}
- } else if (status === K.READY_DIRTY) {
+ } else if (model.getStatusString() === "READY_DIRTY") {
// Try to save XM.SessionStore to database.
model.save(null, saveOptions);
}
Please sign in to comment.
Something went wrong with that request. Please try again.