Просмотр исходного кода

Result contiene valores unicos

Guillermo Espinoza 8 лет назад
Родитель
Сommit
5f8f505d20
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      statsd/endpoint/mysql/index.js

+ 3 - 1
statsd/endpoint/mysql/index.js

@@ -97,7 +97,9 @@ function search(table)
         if (err)
         if (err)
             throw err;
             throw err;
         _.each(rows, function (ts) {
         _.each(rows, function (ts) {
-            result.push(ts.name);
+            if (result.indexOf(ts.name) === -1) { // Se agregan solo los name que no esten en result
+                result.push(ts.name);
+            }
         });
         });
     });
     });