Skip to content

Commit 091add6

Browse files
committed
#692 Fix more PR suggestions.
1 parent 5c4b55d commit 091add6

4 files changed

Lines changed: 8 additions & 4 deletions

File tree

pramen/core/src/main/scala/za/co/absa/pramen/core/app/AppContextImpl.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ class AppContextImpl(val appConfig: AppConfig,
4141

4242
override def close(): Unit = synchronized {
4343
if (closable != null) {
44-
bookkeeper.close()
45-
closable.close()
44+
try {
45+
bookkeeper.close()
46+
} finally {
47+
closable.close()
48+
}
4649
closable = null
4750
}
4851

pramen/core/src/main/scala/za/co/absa/pramen/core/bookkeeper/BookkeeperJdbc.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ class BookkeeperJdbc(pramenDb: PramenDb, batchId: Long, autoCloseDb: Boolean) ex
316316
/** This method is for migration purposes*/
317317
private[pramen] def saveSchemaRaw(table: String, infoDate: String, schema: String): Unit = {
318318
try {
319+
slickUtils.ensureDbConnected(pramenDb.slickDb)
319320
pramenDb.slickDb.run(
320321
pramenDb.schemaTable.records.filter(t => t.pramenTableName === table && t.infoDate === infoDate).delete
321322
).execute()

pramen/core/src/main/scala/za/co/absa/pramen/core/notify/pipeline/PipelineNotificationBuilderHtml.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ class PipelineNotificationBuilderHtml(implicit conf: Config) extends PipelineNot
762762
}
763763

764764
tableBuilder.withRow(Seq(
765-
TextElement(diff.tableName),
765+
TextElement(StringUtils.escapeHTML(diff.tableName)),
766766
changeCell,
767767
oldColumnCell,
768768
newColumnCell,

pramen/core/src/test/scala/za/co/absa/pramen/core/tests/lock/TokenLockSQLiteSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class TokenLockSQLiteSuite extends AnyWordSpec with BeforeAndAfter with BeforeA
3434

3535
before {
3636
if (pramenDb != null) pramenDb.close()
37-
val dbFile = new File("pramen.sqlite", tempDir)
37+
val dbFile = new File(tempDir, "pramen.sqlite")
3838
if (dbFile.exists()) {
3939
dbFile.delete()
4040
}

0 commit comments

Comments
 (0)