From 21cac7910db91f8a27ef5ab41ca169ef5456b74a Mon Sep 17 00:00:00 2001 From: yoshinorin Date: Wed, 19 Jun 2024 00:01:22 +0900 Subject: [PATCH] refactor(db): comment out unnecessary `ExecutionContext` --- .../qualtet/infrastructure/db/doobie/DoobieExecuter.scala | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala index 2f9e6bb7..856a3a6c 100644 --- a/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala +++ b/src/main/scala/net/yoshinorin/qualtet/infrastructure/db/doobie/DoobieExecuter.scala @@ -1,7 +1,5 @@ package net.yoshinorin.qualtet.infrastructure.db.doobie -import java.util.concurrent.{ExecutorService, Executors} -import scala.concurrent.ExecutionContextExecutor import cats.implicits.catsSyntaxApplicativeId import doobie.* import doobie.implicits.* @@ -12,11 +10,10 @@ import net.yoshinorin.qualtet.infrastructure.db.Executer class DoobieExecuter(tx: Transactor[IO]) extends Executer[ConnectionIO, IO] { - val executors: ExecutorService = Executors.newCachedThreadPool() - val executionContexts: ExecutionContextExecutor = scala.concurrent.ExecutionContext.fromExecutor(executors) - // NOTE: No-need ContextShift: https://typelevel.org/cats-effect/docs/migration-guide#contextshift // implicit val cs: ContextShift[IO] = IO.contextShift(executionContexts) + // val executors: ExecutorService = Executors.newCachedThreadPool() + // val executionContexts: ExecutionContextExecutor = scala.concurrent.ExecutionContext.fromExecutor(executors) override def perform[R](action: Action[R]): ConnectionIO[R] = action match { case continue: Continue[ConnectionIO, R, _] => continue.request.flatMap { t => perform(continue.next(t)) }