buildreporter: move reporting into server callback

This commit is contained in:
Jimmy Zelinskie 2015-02-17 15:31:53 -05:00
parent 25fc999d50
commit d70c95e42e
3 changed files with 3 additions and 6 deletions

View file

@ -1,7 +1,6 @@
import logging
import uuid
from app import build_metrics
from buildman.component.basecomponent import BaseComponent
from buildman.component.buildcomponent import BuildComponent
from buildman.manager.basemanager import BaseManager
@ -76,7 +75,6 @@ class EnterpriseManager(BaseManager):
@coroutine
def job_completed(self, build_job, job_status, build_component):
build_metrics.report(job_status)
self.job_complete_callback(build_job, job_status)
def build_component_disposed(self, build_component, timed_out):

View file

@ -10,7 +10,6 @@ from trollius import From, coroutine, Return, async
from concurrent.futures import ThreadPoolExecutor
from urllib3.exceptions import ReadTimeoutError, ProtocolError
from app import build_metrics
from buildman.manager.basemanager import BaseManager
from buildman.manager.executor import PopenExecutor, EC2Executor
from buildman.component.buildcomponent import BuildComponent
@ -287,8 +286,6 @@ class EphemeralBuilderManager(BaseManager):
job_key = self._etcd_job_key(build_job)
yield From(self._etcd_client.delete(job_key))
build_metrics.report(job_status)
self.job_complete_callback(build_job, job_status)
@coroutine

View file

@ -15,7 +15,7 @@ from datetime import timedelta
from buildman.jobutil.buildstatus import StatusHandler
from buildman.jobutil.buildjob import BuildJob, BuildJobLoadException
from data import database
from app import app
from app import app, build_metrics
# pylint: disable=invalid-name
logger = logging.getLogger(__name__)
@ -135,6 +135,8 @@ class BuilderServer(object):
minimum_extension=MINIMUM_JOB_EXTENSION)
def _job_complete(self, build_job, job_status):
build_metrics.report(job_status)
if job_status == BuildJobResult.INCOMPLETE:
self._queue.incomplete(build_job.job_item, restore_retry=False, retry_after=30)
else: