Skip to content

Commit

Permalink
Merge pull request #24253 from VanillaSpoon/misfireThreshold
Browse files Browse the repository at this point in the history
Add misfireThreshold default to QuartzRuntimeConfig.java
  • Loading branch information
machi1990 authored Mar 11, 2022
2 parents 658f825 + 8a292db commit bf3cca2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.quarkus.quartz.runtime;

import java.time.Duration;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
Expand All @@ -25,6 +27,12 @@ public class QuartzRuntimeConfig {
@ConfigItem(defaultValue = "5")
public int threadPriority;

/**
* Defines how late the schedulers should be to be considered misfired.
*/
@ConfigItem(defaultValue = "60")
public Duration misfireThreshold;

/**
* Scheduler can be started in different modes: normal, forced or halted.
* By default, the scheduler is not started unless a {@link io.quarkus.scheduler.Scheduled} business method
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ private Properties getSchedulerConfigurationProperties(QuartzSupport quartzSuppo
String dataSource = buildTimeConfig.dataSourceName.orElse("QUARKUS_QUARTZ_DEFAULT_DATASOURCE");
QuarkusQuartzConnectionPoolProvider.setDataSourceName(dataSource);
props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".useProperties", "true");
props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".misfireThreshold", "60000");
props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".misfireThreshold",
"" + quartzSupport.getRuntimeConfig().misfireThreshold.toMillis());
props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".tablePrefix", buildTimeConfig.tablePrefix);
props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".dataSource", dataSource);
props.put(StdSchedulerFactory.PROP_JOB_STORE_PREFIX + ".driverDelegateClass",
Expand Down

0 comments on commit bf3cca2

Please sign in to comment.