Skip to content

Commit

Permalink
#1610 Don't update analyzer tags if job status is not success
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 3, 2020
1 parent e622b42 commit 05b751b
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,15 @@ class JobSrv @Inject() (
}

private def importAnalyzerTags(job: Job with Entity, cortexJob: CortexJob)(implicit authContext: AuthContext): Try[Unit] =
db.tryTransaction { implicit graph =>
val tags = cortexJob.report.fold[Seq[ReportTag]](Nil)(_.summary.map(_.toAnalyzerTag(job.workerName)))
for {
observable <- get(job).observable.getOrFail("Observable")
_ <- reportTagSrv.updateTags(observable, job.workerName, tags)
} yield ()
}
if (cortexJob.status == JobStatus.Success)
db.tryTransaction { implicit graph =>
val tags = cortexJob.report.fold[Seq[ReportTag]](Nil)(_.summary.map(_.toAnalyzerTag(job.workerName)))
for {
observable <- get(job).observable.getOrFail("Observable")
_ <- reportTagSrv.updateTags(observable, job.workerName, tags)
} yield ()
}
else Success(())

/**
* Create observable for each artifact of the job report
Expand Down

0 comments on commit 05b751b

Please sign in to comment.