Authored by 姜枫

add empty logs

@@ -32,6 +32,10 @@ class ApiCache { @@ -32,6 +32,10 @@ class ApiCache {
32 32
33 this.memcached.items( ( err, result ) => { 33 this.memcached.items( ( err, result ) => {
34 if( err ) console.error( err ); 34 if( err ) console.error( err );
  35 +
  36 + if (result.length === 0) {
  37 + this._log('empty items')
  38 + }
35 // for each server... 39 // for each server...
36 result.forEach(itemSet => { 40 result.forEach(itemSet => {
37 41
@@ -39,6 +43,10 @@ class ApiCache { @@ -39,6 +43,10 @@ class ApiCache {
39 keys.pop(); // we don't need the "server" key, but the other indicate the slab id's 43 keys.pop(); // we don't need the "server" key, but the other indicate the slab id's
40 44
41 var len = keys.length; 45 var len = keys.length;
  46 +
  47 + if (keys.length === 0) {
  48 + this._log('empty item set');
  49 + }
42 50
43 keys.forEach(stats => { 51 keys.forEach(stats => {
44 52
@@ -158,7 +158,7 @@ const p = { @@ -158,7 +158,7 @@ const p = {
158 projectId: pid 158 projectId: pid
159 }).sort({ 159 }).sort({
160 buildTime: -1 160 buildTime: -1
161 - }).exec(); 161 + }).limit(30).exec();
162 buildings.forEach(b => { 162 buildings.forEach(b => {
163 b.updatedAt = moment(b.updatedAt).format('YYYY-MM-DD HH:mm:ss'); 163 b.updatedAt = moment(b.updatedAt).format('YYYY-MM-DD HH:mm:ss');
164 }); 164 });