Browse Source

Result contiene valores unicos

Guillermo Espinoza 8 năm trước cách đây
mục cha
commit
5f8f505d20
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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);
+            }
         });
     });