sessionstore
Advanced tools
Comparing version 1.2.9 to 1.2.10
@@ -77,3 +77,3 @@ 'use strict'; | ||
if (err) { | ||
if (callback) { | ||
if (callback && !callbacked) { | ||
callbacked = true; | ||
@@ -95,3 +95,3 @@ callback(err, self); | ||
if (err) { | ||
if (callback) { | ||
if (callback && !callbacked) { | ||
callbacked = true; | ||
@@ -105,3 +105,3 @@ callback(err, self); | ||
self.emit('connect'); | ||
if (callback) { | ||
if (callback && !callbacked) { | ||
callbacked = true; | ||
@@ -133,4 +133,4 @@ callback(err, self); | ||
sess._version = sess._version || 1; | ||
sess._version++; | ||
// sess._version = sess._version || 1; | ||
// sess._version++; | ||
@@ -141,5 +141,6 @@ this.client.index({ | ||
id: this.options.prefix + sid, | ||
version: sess._version > 2 ? sess._version - 1 : undefined, | ||
ttl: ttl, | ||
body: sess | ||
// version: sess._version > 2 ? sess._version - 1 : undefined, | ||
ttl: ttl + 'ms', | ||
body: sess, | ||
refresh: true | ||
}, function (err, res) { | ||
@@ -163,3 +164,3 @@ if (err && (err.message.toLowerCase().indexOf('version') >= 0)) { | ||
}, function (err, res) { | ||
if (err && err.message.toLowerCase().indexOf('not found') >= 0) { | ||
if (err && (err.message.toLowerCase().indexOf('not found') >= 0 || err.message.toLowerCase().indexOf('no such index') >= 0)) { | ||
err = null; | ||
@@ -194,17 +195,12 @@ } | ||
clear: function (callback) { | ||
this.client.deleteByQuery({ | ||
index: this.index, | ||
type: this.typeName, | ||
body: { | ||
query: { | ||
bool: { | ||
must: [ | ||
{ | ||
match_all: {} | ||
} | ||
] | ||
} | ||
} | ||
var self = this; | ||
this.client.indices.exists({index: this.index}, function (err, result) { | ||
if (result){ | ||
self.client.indices.delete({index: self.index}, function (err) { | ||
if (callback) callback(err); | ||
}); | ||
} else { | ||
if (callback) callback(err); | ||
} | ||
}, callback || function () {}); | ||
}); | ||
} | ||
@@ -211,0 +207,0 @@ |
{ | ||
"author": "adrai", | ||
"name": "sessionstore", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"private": false, | ||
@@ -14,5 +14,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"async": "1.5.0", | ||
"async": "1.5.2", | ||
"jsondate": "0.0.1", | ||
"lodash": "3.10.1", | ||
"lodash": "4.5.0", | ||
"parent-require": "1.0.0", | ||
@@ -23,3 +23,3 @@ "tolerance": "1.0.0" | ||
"cradle": ">=0.2.7", | ||
"elasticsearch": "8.x.x", | ||
"elasticsearch": ">= 10.0.0", | ||
"eslint": ">=1.0.0", | ||
@@ -26,0 +26,0 @@ "expect.js": ">= 0.1.2", |
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
41769
1060
+ Addedasync@1.5.2(transitive)
+ Addedlodash@4.5.0(transitive)
- Removedasync@1.5.0(transitive)
- Removedlodash@3.10.1(transitive)
Updatedasync@1.5.2
Updatedlodash@4.5.0