fix(cp-frontend): poll even when no services (service list)

This commit is contained in:
Sérgio Ramos 2017-08-30 15:06:58 +01:00
parent d9ae6eb34a
commit 94c664fecc
1 changed files with 2 additions and 8 deletions

View File

@ -179,18 +179,12 @@ export default compose(
}),
withServiceMetricsPolling({
pollingInterval: 1000,
getPreviousEnd: ({ loading, error, services = [] }) => {
getPreviousEnd: ({ loading, services = [] }) => {
if (loading) {
return false;
}
const _services = forceArray(services);
if (!_services.length) {
return false;
}
const previousEnd = _services
const previousEnd = forceArray(services)
.map(service => get(service, 'instances[0].metrics[0].end', null))
.filter(Boolean)
.shift();