Skip to content

Commit

Permalink
update guice modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Marx committed Sep 10, 2024
1 parent 42497d8 commit 96aaa3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
*
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96aaa3b

Please sign in to comment.