Skip to content

Commit

Permalink
check point
Browse files Browse the repository at this point in the history
  • Loading branch information
hohonuuli committed Jan 27, 2025
1 parent 5cd1b09 commit f75e625
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.mbari.oni.jpa.EntityManagerFactories.*
import org.mbari.oni.jpa.entities.HistoryEntity
import org.mbari.oni.jpa.repositories.HistoryRepository

import java.util.Objects
import scala.jdk.CollectionConverters.*
import scala.jdk.OptionConverters.*
import scala.util.Try
Expand All @@ -38,7 +39,7 @@ class HistoryService(entityManagerFactory: EntityManagerFactory):
repo.findPendingHistories(limit, offset)
.asScala
.toSeq
.flatMap(h => Try(ExtendedHistory.from(h.getConceptMetadata.getConcept.getPrimaryConceptName.getName, h)).toOption) // TRY because of the potential for nulls
.map(h => ExtendedHistory.from(h.getConceptMetadata.getConcept.getPrimaryConceptName.getName, h)) // TRY because of the potential for nulls
.sortBy(_.creationTimestamp)
)

Expand All @@ -48,7 +49,7 @@ class HistoryService(entityManagerFactory: EntityManagerFactory):
repo.findApprovedHistories()
.asScala
.toSeq
.flatMap(h => Try(ExtendedHistory.from(h.getConceptMetadata.getConcept.getPrimaryConceptName.getName, h)).toOption) // TRY because of the potential for nulls
.map(h => ExtendedHistory.from(h.getConceptMetadata.getConcept.getPrimaryConceptName.getName, h)) // TRY because of the potential for nulls
.sortBy(_.creationTimestamp)
)

Expand Down

0 comments on commit f75e625

Please sign in to comment.