From 72bfc504cc1d22fa365faa9bd278e8009fa586d0 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 9 Feb 2016 14:48:38 +0100 Subject: [PATCH] [IMP] runbot: hide stopped hosts from dashboard page --- runbot/runbot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index 8b3b7a90..62165cca 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -1346,7 +1346,9 @@ class RunbotController(http.Controller): b = r['branches'].setdefault(branch.id, {'name': branch.branch_name, 'builds': list()}) b['builds'].append(self.build_info(build)) - for result in RB.read_group([], ['host'], ['host']): + # consider host gone if no build in last 100 + build_threshold = max(builds.ids or [0]) - 100 + for result in RB.read_group([('id', '>', build_threshold)], ['host'], ['host']): if result['host']: qctx['host_stats'].append({ 'host': result['host'],