From 589b32f77ce4cd1cfe16725c5777e7c0b1a4b165 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 12 Jun 2024 22:55:40 +0100 Subject: [PATCH] Update SlickOffsetStore.scala --- .../pekko/projection/slick/internal/SlickOffsetStore.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/slick/src/main/scala/org/apache/pekko/projection/slick/internal/SlickOffsetStore.scala b/slick/src/main/scala/org/apache/pekko/projection/slick/internal/SlickOffsetStore.scala index 111057a2..d19fd15b 100644 --- a/slick/src/main/scala/org/apache/pekko/projection/slick/internal/SlickOffsetStore.scala +++ b/slick/src/main/scala/org/apache/pekko/projection/slick/internal/SlickOffsetStore.scala @@ -45,7 +45,7 @@ import slick.jdbc.JdbcProfile system: ActorSystem[_], databaseConfig: DatabaseConfig[P], slickSettings: SlickSettings, - clock: Clock) { + clock: Clock) extends AutoCloseable { def this(system: ActorSystem[_], databaseConfig: DatabaseConfig[P], slickSettings: SlickSettings) = this(system, databaseConfig, slickSettings, Clock.systemUTC()) @@ -220,4 +220,8 @@ import slick.jdbc.JdbcProfile db.run(action).map(_ => Done)(ExecutionContexts.parasitic) } + + def close(): Unit = { + db.close() + } }