Skip to content

Commit

Permalink
Add misfireThreshold default to QuartzRuntimeConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
VanillaSpoon committed Mar 10, 2022
1 parent b62e798 commit 1467d4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,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,9 @@ 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 1467d4c

Please sign in to comment.