From bd971a7da0161d9678aaac12e1af73fe2d81ab3d Mon Sep 17 00:00:00 2001 From: volpino Date: Tue, 12 Jun 2012 14:55:58 +0200 Subject: [PATCH] euscanwww: When scanning upstream output object was never cleaned Signed-off-by: volpino --- euscanwww/djeuscan/tasks.py | 4 ++++ pym/euscan/out.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/euscanwww/djeuscan/tasks.py b/euscanwww/djeuscan/tasks.py index a9341d4..897f9b6 100644 --- a/euscanwww/djeuscan/tasks.py +++ b/euscanwww/djeuscan/tasks.py @@ -8,6 +8,8 @@ from celery.task.sets import TaskSet from django.conf import settings +from euscan import output as euscan_output + from djeuscan.models import Package, RefreshPackageQuery from djeuscan.management.commands.regen_rrds import regen_rrds from djeuscan.management.commands.update_counters import update_counters @@ -129,8 +131,10 @@ def scan_upstream_task(query): logger = scan_upstream_task.get_logger() logger.info("Starting upstream scanning for package %s ...", query) + euscan_output.clean() scan_upstream = ScanUpstream() result = scan_upstream.scan(query) + euscan_output.clean() if not result or result == {}: raise TaskFailedException("Couldn't scan upstream") return result diff --git a/pym/euscan/out.py b/pym/euscan/out.py index 6a98336..1a61579 100644 --- a/pym/euscan/out.py +++ b/pym/euscan/out.py @@ -76,6 +76,10 @@ class EuscanOutput(object): self.queries = defaultdict(dict) self.current_query = None + def clean(self): + self.queries = defaultdict(dict) + self.current_query = None + def set_query(self, query): self.current_query = query if query is None: