From 4c7b05b48dbb29db577ac7488638344ea62d5c4e Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 24 Mar 2019 08:17:58 -0700 Subject: [PATCH] server: Add the CacheModule which loads the available caches --- server/app/com/xsn/explorer/modules/CacheModule.scala | 11 +++++++++++ server/conf/application.conf | 1 + 2 files changed, 12 insertions(+) create mode 100644 server/app/com/xsn/explorer/modules/CacheModule.scala diff --git a/server/app/com/xsn/explorer/modules/CacheModule.scala b/server/app/com/xsn/explorer/modules/CacheModule.scala new file mode 100644 index 0000000..95272ab --- /dev/null +++ b/server/app/com/xsn/explorer/modules/CacheModule.scala @@ -0,0 +1,11 @@ +package com.xsn.explorer.modules + +import com.google.inject.AbstractModule +import com.xsn.explorer.cache.BlockHeaderCache + +class CacheModule extends AbstractModule { + + override def configure(): Unit = { + bind(classOf[BlockHeaderCache]).toInstance(BlockHeaderCache.default) + } +} diff --git a/server/conf/application.conf b/server/conf/application.conf index d9dd441..a7b8180 100644 --- a/server/conf/application.conf +++ b/server/conf/application.conf @@ -47,6 +47,7 @@ synchronizer { } play.modules.enabled += "com.xsn.explorer.modules.DataHandlerModule" +play.modules.enabled += "com.xsn.explorer.modules.CacheModule" play.modules.enabled += "com.xsn.explorer.modules.ConfigModule" play.modules.enabled += "com.xsn.explorer.modules.ExecutorsModule" play.modules.enabled += "com.xsn.explorer.modules.PollerSynchronizerModule"