Skip to content

Commit

Permalink
chore: improve transaction handling during project analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
filipowm committed Aug 1, 2022
1 parent 27c8984 commit 875dcb7
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ internal class ProjectScoringAnalysisService(
private fun analyze(entity: ProjectEntity, progressMonitor: ProgressMonitor) {
analysisScope.launch {
try {
entity.project = analyze(entity.project)
entity.updateScore(entity.project)
val analyzedProject = analyze(entity.project)
transactionTemplate.executeWithoutResult {
entity.project = analyzedProject
entity.updateScore(analyzedProject)
val savedEntity = projectEntityRepository.save(entity)
val historyEntry = ProjectStatisticsHistory.from(savedEntity)
val entryDate = historyEntry.date.toLocalDate().atStartOfDay()
Expand Down

0 comments on commit 875dcb7

Please sign in to comment.