From 96aaa3bb58cc8ffbb7b56f5140e50a9b154c0933 Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Tue, 10 Sep 2024 16:33:36 +0200 Subject: [PATCH] update guice modules --- .../cms/server/configs/ServerGlobalModule.java | 15 +++++++++++---- .../thmarx/cms/server/configs/SiteModule.java | 2 -- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cms-server/src/main/java/com/github/thmarx/cms/server/configs/ServerGlobalModule.java b/cms-server/src/main/java/com/github/thmarx/cms/server/configs/ServerGlobalModule.java index eeeeb2f1..3d4da898 100644 --- a/cms-server/src/main/java/com/github/thmarx/cms/server/configs/ServerGlobalModule.java +++ b/cms-server/src/main/java/com/github/thmarx/cms/server/configs/ServerGlobalModule.java @@ -23,7 +23,6 @@ */ import com.github.thmarx.cms.api.PropertiesLoader; import com.github.thmarx.cms.api.ServerProperties; -import com.github.thmarx.cms.api.configuration.configs.ServerConfiguration; import com.google.inject.Binder; import com.google.inject.Provides; import com.google.inject.Singleton; @@ -34,7 +33,9 @@ import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.SchedulerFactory; -import org.quartz.impl.StdSchedulerFactory; +import org.quartz.impl.DirectSchedulerFactory; +import org.quartz.simpl.RAMJobStore; +import org.quartz.simpl.SimpleThreadPool; /** * @@ -52,8 +53,14 @@ public void configure(Binder binder) { @Singleton public Scheduler scheduler() { try { - SchedulerFactory schedulerFactory = new StdSchedulerFactory(); - var scheduler = schedulerFactory.getScheduler(); + + DirectSchedulerFactory schedulerFactory = DirectSchedulerFactory.getInstance(); + schedulerFactory.createScheduler( + "cms-scheduler", + "cms-scheduler", + new SimpleThreadPool(5, Thread.NORM_PRIORITY), + new RAMJobStore()); + var scheduler = schedulerFactory.getScheduler("cms-scheduler"); scheduler.start(); return scheduler; diff --git a/cms-server/src/main/java/com/github/thmarx/cms/server/configs/SiteModule.java b/cms-server/src/main/java/com/github/thmarx/cms/server/configs/SiteModule.java index 6c0bc5be..c725211b 100644 --- a/cms-server/src/main/java/com/github/thmarx/cms/server/configs/SiteModule.java +++ b/cms-server/src/main/java/com/github/thmarx/cms/server/configs/SiteModule.java @@ -96,8 +96,6 @@ protected void configure() { bind(TaxonomyFunction.class).in(Singleton.class); bind(ContentNodeMapper.class).in(Singleton.class); bind(TaxonomyResolver.class).in(Singleton.class); - - bind(ConfigurationManagement.class).in(Singleton.class); } @Provides