浏览代码

Result contiene valores unicos

Guillermo Espinoza 8 年之前
父节点
当前提交
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)
             throw err;
         _.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);
+            }
         });
     });