euscanwww: When scanning upstream output object was never cleaned

Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
volpino 2012-06-12 14:55:58 +02:00
parent 7367596e33
commit bd971a7da0
2 changed files with 8 additions and 0 deletions

View File

@ -8,6 +8,8 @@ from celery.task.sets import TaskSet
from django.conf import settings from django.conf import settings
from euscan import output as euscan_output
from djeuscan.models import Package, RefreshPackageQuery from djeuscan.models import Package, RefreshPackageQuery
from djeuscan.management.commands.regen_rrds import regen_rrds from djeuscan.management.commands.regen_rrds import regen_rrds
from djeuscan.management.commands.update_counters import update_counters 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 = scan_upstream_task.get_logger()
logger.info("Starting upstream scanning for package %s ...", query) logger.info("Starting upstream scanning for package %s ...", query)
euscan_output.clean()
scan_upstream = ScanUpstream() scan_upstream = ScanUpstream()
result = scan_upstream.scan(query) result = scan_upstream.scan(query)
euscan_output.clean()
if not result or result == {}: if not result or result == {}:
raise TaskFailedException("Couldn't scan upstream") raise TaskFailedException("Couldn't scan upstream")
return result return result

View File

@ -76,6 +76,10 @@ class EuscanOutput(object):
self.queries = defaultdict(dict) self.queries = defaultdict(dict)
self.current_query = None self.current_query = None
def clean(self):
self.queries = defaultdict(dict)
self.current_query = None
def set_query(self, query): def set_query(self, query):
self.current_query = query self.current_query = query
if query is None: if query is None: