uber-archive / hyperbahn

Service discovery and routing for large scale microservice operations
MIT License
396 stars 57 forks source link

IntervalScan doesn't work with arrays #279

Open severb opened 8 years ago

severb commented 8 years ago

I'm using this code to smear a tight loop but it doesn't work on arrays. I think the problem is here: https://github.com/uber/hyperbahn/blob/master/lib/interval-scan.js#L141.

kriskowal commented 8 years ago

Correct, this should be an array of indexes, which is easiest to obtain with Object.keys(array), proper to generate an array of indexes, better to iterate differently for arrays and objects.