Comparing version 0.6.0 to 0.7.0
@@ -247,2 +247,18 @@ const crypto = require('crypto'); | ||
/** | ||
* Retrieves oldest session of user | ||
* | ||
* @param {string} userId | ||
* @param {boolean} [noUpdate=false] | ||
* @return {Promise<Session>} | ||
*/ | ||
getOldestUserSession(userId, noUpdate) { | ||
if (!userId) | ||
return Promise.reject(new ArgumentError('You must provide userId')); | ||
return this._getClient().then(client => { | ||
return client.zrevrange(this._ns + ':user_' + userId, '-1', '-1').then( | ||
sessionId => this.get(sessionId, noUpdate)); | ||
}); | ||
} | ||
/** | ||
* Returns true if sessionId exists, false otherwise, | ||
@@ -296,3 +312,3 @@ * | ||
return this._getClient().then(client => | ||
killAllScript.execute(client, this._ns + ':*').then(() => true) | ||
killAllScript.execute(client, this._ns + ':*').then(() => true) | ||
); | ||
@@ -337,3 +353,3 @@ } | ||
setTimeout(() => { | ||
this._wipe().catch(/* istanbul ignore next */() => 1) | ||
this._wipe().catch(/* istanbul ignore next */() => 1); | ||
}, this._wipeInterval) | ||
@@ -350,3 +366,3 @@ .unref(); | ||
return this._getClient().then(client => | ||
wipeScript.execute(client, this._ns, this._now()) | ||
wipeScript.execute(client, this._ns, this._now()) | ||
); | ||
@@ -353,0 +369,0 @@ } |
{ | ||
"name": "redisess", | ||
"description": "Powerful redis session manager for NodeJS", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"author": "Panates Ltd.", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22718
657