Commit 6e7dd7b990f1ac0053ed24716cee437f512c4ba7

Authored by Geoffrey PREUD'HOMME
1 parent 83c88813

Mise à jour des dépendances

Showing 2 changed files with 10 additions and 9 deletions   Show diff stats
app/services/PolyUserServ.js
@@ -4,7 +4,9 @@ var Client = require('ssh2').Client; @@ -4,7 +4,9 @@ var Client = require('ssh2').Client;
4 var creds = require('../../config/sshAuth'); 4 var creds = require('../../config/sshAuth');
5 var NodeCache = require("node-cache"); 5 var NodeCache = require("node-cache");
6 6
7 -var cache = new NodeCache(); 7 +var cache = new NodeCache({
  8 + stdTTL: 24 * 60 * 60
  9 +});
8 10
9 var PolyUserServ = {}; 11 var PolyUserServ = {};
10 12
@@ -125,10 +127,10 @@ PolyUserServ.get = function (login, cb) { @@ -125,10 +127,10 @@ PolyUserServ.get = function (login, cb) {
125 if (err) { 127 if (err) {
126 cb(err); 128 cb(err);
127 } else { 129 } else {
128 - if (data[login] === undefined) {  
129 - PolyUserServ.add(login, cb); 130 + if (data) {
  131 + cb(null, data);
130 } else { 132 } else {
131 - cb(null, data[login]); 133 + PolyUserServ.add(login, cb);
132 } 134 }
133 } 135 }
134 }); 136 });
@@ -4,15 +4,14 @@ @@ -4,15 +4,14 @@
4 "repository": "https://github.com/ClubInfoPolytechLille/ci-site", 4 "repository": "https://github.com/ClubInfoPolytechLille/ci-site",
5 "dependencies": { 5 "dependencies": {
6 "async": "^0.9.0", 6 "async": "^0.9.0",
7 - "body-parser": "^1.12.2", 7 + "body-parser": "^1.12.3",
8 "compression": "^1.4.3", 8 "compression": "^1.4.3",
9 - "connect-mongo": "^0.8.0", 9 + "connect-mongo": "^0.8.1",
10 "cookie-parser": "^1.3.4", 10 "cookie-parser": "^1.3.4",
11 "express": "^4.12.3", 11 "express": "^4.12.3",
12 - "express-http-proxy": "^0.5.0",  
13 "express-session": "^1.11.1", 12 "express-session": "^1.11.1",
14 - "mongoose": "^4.0.1",  
15 - "node-cache": "^1.1.0", 13 + "mongoose": "^4.0.2",
  14 + "node-cache": "^2.1.1",
16 "node-line-reader": "0.0.2", 15 "node-line-reader": "0.0.2",
17 "serve-favicon": "^2.2.0", 16 "serve-favicon": "^2.2.0",
18 "ssh2": "^0.4.6", 17 "ssh2": "^0.4.6",