Explorar o código

Result contiene valores unicos

Guillermo Espinoza %!s(int64=8) %!d(string=hai) anos
pai
achega
5f8f505d20
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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);
+            }
         });
     });