Skip to content

Commit

Permalink
make sure spark session is closed (#69)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Moskalenko <moskalenko.alexey@gmail.com>
  • Loading branch information
pyalex committed May 5, 2021
1 parent f7d048b commit 7a279c4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,11 @@ object IngestionJob {
config.mode match {
case Modes.Offline =>
val sparkSession = BasePipeline.createSparkSession(config)
BatchPipeline.createPipeline(sparkSession, config)
sparkSession.close()
try {
BatchPipeline.createPipeline(sparkSession, config)
} finally {
sparkSession.close()
}
case Modes.Online =>
val sparkSession = BasePipeline.createSparkSession(config)
try {
Expand Down

0 comments on commit 7a279c4

Please sign in to comment.