From 96d5d4255457c2ce7b052432aa591b2e419cad93 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Sat, 17 Jan 2015 14:37:04 +0000 Subject: [PATCH] Bug 1067409 - Filter on repository active_status in more cases We should only include active repositories when performing init_datasources or calculating job etas. --- treeherder/model/management/commands/init_datasources.py | 2 +- treeherder/model/tasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/treeherder/model/management/commands/init_datasources.py b/treeherder/model/management/commands/init_datasources.py index c02b3b155..a3c102069 100644 --- a/treeherder/model/management/commands/init_datasources.py +++ b/treeherder/model/management/commands/init_datasources.py @@ -44,7 +44,7 @@ Type 'yes' to continue, or 'no' to cancel: """) for ds in Datasource.objects.all(): ds.delete() - projects = Repository.objects.all().values_list('name', flat=True) + projects = Repository.objects.filter(active_status='active').values_list('name', flat=True) for project in projects: for contenttype in ("jobs", "objectstore"): Datasource.objects.get_or_create( diff --git a/treeherder/model/tasks.py b/treeherder/model/tasks.py index dc1fca5c0..4b079a6ca 100644 --- a/treeherder/model/tasks.py +++ b/treeherder/model/tasks.py @@ -41,7 +41,7 @@ def cycle_data(): @task(name='calculate-eta', rate_limit='1/h') def calculate_eta(sample_window_seconds=21600, debug=False): - projects = Repository.objects.all().values_list('name', flat=True) + projects = Repository.objects.filter(active_status='active').values_list('name', flat=True) for project in projects: