Roiocam commented on code in PR #167:
URL: https://github.com/apache/pekko-projection/pull/167#discussion_r1636101362


##########
slick/src/main/scala/org/apache/pekko/projection/slick/internal/SlickOffsetStore.scala:
##########
@@ -35,23 +35,27 @@ import pekko.projection.jdbc.internal.MySQLDialect
 import pekko.projection.jdbc.internal.OracleDialect
 import pekko.projection.jdbc.internal.PostgresDialect
 import pekko.util.Helpers.toRootLowerCase
+import slick.basic.DatabaseConfig
 import slick.jdbc.JdbcProfile
 
 /**
  * INTERNAL API
  */
 @InternalApi private[projection] class SlickOffsetStore[P <: JdbcProfile](
     system: ActorSystem[_],
-    val db: P#Backend#Database,
-    val profile: P,
+    databaseConfig: DatabaseConfig[P],
     slickSettings: SlickSettings,
     clock: Clock) {
+
+  def this(system: ActorSystem[_], databaseConfig: DatabaseConfig[P], 
slickSettings: SlickSettings) =
+    this(system, databaseConfig, slickSettings, Clock.systemUTC())
+
+  private[projection] val profile: P = databaseConfig.profile
+  private val db = databaseConfig.db

Review Comment:
   We initialized it but didn't close it, would it be better to use lazy in 
this field?
   
   These changes didn't seem harmless, maybe there is a issue hidden in the 
shadows.
   
   
https://github.com/slick/slick/blob/b878d45556fb6b4799e62a5d3c08364def51a89f/slick/src/main/scala/slick/basic/DatabaseConfig.scala#L15-L18
   
   
https://github.com/apache/pekko-persistence-jdbc/blob/c3621706de0b43bbb0f60d224d784085fa3197cf/core/src/main/scala/org/apache/pekko/persistence/jdbc/db/SlickDatabase.scala#L106-L118



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@pekko.apache.org
For additional commands, e-mail: notifications-h...@pekko.apache.org

Reply via email to