diff --git a/Dockerfile_akka_loader b/Dockerfile_akka_loader index 358bc0e7..f4d73808 100644 --- a/Dockerfile_akka_loader +++ b/Dockerfile_akka_loader @@ -6,4 +6,4 @@ RUN sbt akkaLoader/assembly FROM eclipse-temurin:11.0.21_9-jre-jammy WORKDIR /app/ COPY --from=sources /app/akka-loader/target/scala-2.13/akka-loader-assembly-0.1.jar /app/ -ENTRYPOINT ["java", "-Xmx6096m", "-Xms256m", "-jar", "/app/akka-loader-assembly-0.1.jar"] +ENTRYPOINT ["timeout", "4h", "java", "-Xmx6096m", "-Xms256m", "-jar", "/app/akka-loader-assembly-0.1.jar"] diff --git a/akka-loader/src/main/scala/LoaderApp.scala b/akka-loader/src/main/scala/LoaderApp.scala index eccf061b..a51c6c53 100644 --- a/akka-loader/src/main/scala/LoaderApp.scala +++ b/akka-loader/src/main/scala/LoaderApp.scala @@ -78,6 +78,10 @@ object LoaderApp extends App { case e: Throwable => logger.error(e.getMessage, e) actorSystem.terminate() + + // clickhouse-scheduled may not be terminated + Thread.sleep(10000) + System.exit(0) } private def executorAndScheduler(entity: String, lastMatchesWindow: Int, executorActorFactory: ExecutorActorFactory, worldDetails: WorldDetails): (ActorRef, AbstractScheduler) = {