Remove extra promise nonsense

pull/210/head
Will Piers 2016-10-10 14:34:07 -07:00
parent 6d16778d3d
commit 2f601ad509
1 changed files with 19 additions and 21 deletions

View File

@ -2,8 +2,7 @@ import {proxy} from 'utils/queryUrlGenerator';
import _ from 'lodash';
export function getCpuAndLoadForHosts(proxyLink) {
return new Promise((resolve, reject) => {
proxy({
return proxy({
source: proxyLink,
query: `select mean(usage_user) from cpu where cpu = 'cpu-total' and time > now() - 10m group by host; select mean("load1") from "telegraf"."default"."system" where time > now() - 10m group by host`,
db: 'telegraf',
@ -23,7 +22,6 @@ export function getCpuAndLoadForHosts(proxyLink) {
hosts[s.tags.host].load = (Math.round(s.values[0][meanIndex] * precision) / precision).toFixed(2);
});
resolve(_.values(hosts));
}).catch(reject);
return _.values(hosts);
});
}