8000 Moving logger back to static context until we can find a fix for the … · mauricio/postgresql-async@8a6036f · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Dec 3, 2019. It is now read-only.

Commit 8a6036f

Browse files
committed
Moving logger back to static context until we can find a fix for the memory leak
1 parent 888ca29 commit 8a6036f

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

mysql-async/src/main/scala/com/github/mauricio/async/db/mysql/MySQLConnection.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import scala.util.Success
3535
object MySQLConnection {
3636
final val Counter = new AtomicLong()
3737
final val MicrosecondsVersion = Version(5,6,0)
38+
final val log = Log.get[MySQLConnection]
3839
}
3940

4041
class MySQLConnection(
@@ -47,13 +48,14 @@ class MySQLConnection(
4748
with Connection
4849
{
4950

51+
import MySQLConnection.log
52+
5053
// validate that this charset is supported
5154
charsetMapper.toInt(configuration.charset)
5255

5356

5457
private final val connectionCount = MySQLConnection.Counter.incrementAndGet()
5558
private final val connectionId = s"[mysql-connection-$connectionCount]"
56-
private final val log = Log.getByName(connectionId)
5759
private implicit val internalPool = executionContext
5860

5961
private final val connectionHandler = new MySQLConnectionHandler(

postgresql-async/src/main/scala/com/github/mauricio/async/db/postgresql/PostgreSQLConnection.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ import io.netty.channel.EventLoopGroup
3434
import java.util.concurrent.CopyOnWriteArrayList
3535

3636
object PostgreSQLConnection {
37-
val Counter = new AtomicLong()
38-
val ServerVersionKey = "server_version"
37+
final val Counter = new AtomicLong()
38+
final val ServerVersionKey = "server_version"
39+
final val log = Log.get[PostgreSQLConnection]
3940
}
4041

4142
class PostgreSQLConnection
@@ -59,8 +60,8 @@ class PostgreSQLConnection
5960
group,
6061
executionContext
6162
)
63+
6264
private final val currentCount = Counter.incrementAndGet()
63-
private final val log = Log.getByName(s"${this.getClass.getName}")
6465
private final val preparedStatementsCounter = new AtomicInteger()
6566
private final implicit val internalExecutionContext = executionContext
6667

0 commit comments

Comments
 (0)
0