Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ class ModifiedLarRepository(databaseConfig: DatabaseConfig[JdbcProfile]) {
* @return the number of rows removed
*/
def deleteBySubmissionID(submissionId: SubmissionId): Future[Int] = {
val likeStatement = s"${submissionId.lei}-%"
val period = submissionId.period.year
val lei = submissionId.lei
val likeStatement = s"${lei}-%"
db.run(
sqlu"""DELETE FROM #${fetchYearTable(submissionId.period.year.toInt)} WHERE submission_id LIKE $likeStatement"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,22 @@ object ModifiedLarPublisher {
val graphWithJustS3WithHeader = mlarSource.via(serializeMlar).prepend(mlarHeader).toMat(s3SinkWithHeader)(Keep.right)

val finalResult: Future[Unit] = for {
_ <- if (regenerateMlar)
graphWithS3AndPG.run()
else if (isGenerateBothS3Files) {
removeLei
graphWithS3AndPG.run()
} else if (isJustGenerateS3File)
graphWithJustS3NoHeader.run()
else if (isJustGenerateS3FileHeader)
graphWithJustS3WithHeader.run()
else { //everything
removeLei
Future.sequence(List(graphWithJustS3NoHeader.run(), graphWithJustS3WithHeader.run(), graphWithJustPG.run()))
}
_ <- { if (regenerateMlar) {
removeLei
graphWithS3AndPG.run()
}
else if (isGenerateBothS3Files) {
removeLei
graphWithS3AndPG.run()
} else if (isJustGenerateS3File)
graphWithJustS3NoHeader.run()
else if (isJustGenerateS3FileHeader)
graphWithJustS3WithHeader.run()
else { //everything
removeLei
Future.sequence(List(graphWithJustS3NoHeader.run(), graphWithJustS3WithHeader.run(), graphWithJustPG.run()))
}
}
} yield ()

finalResult.onComplete {
Expand Down
Loading