You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`.threads(int)`| Number of threads. Default `10`. |
144
-
|`.pollingInterval(Duration)`| How often the scheduler checks the database for due executions. Default `30s`. |
145
-
|`.pollUsingFetchAndLockOnExecute(double, double)`| Use default polling strategy `fetch-and-lock-on-execute`. `lowerLimitFractionOfThreads`: threshold for when new executions are fetched from the database (given that last batch was full). Default `0.5`. `executionsPerBatchFractionOfThreads`: how many executions to fetch in each batch. Defualt `3.0`. These executions will not be pre-locked, so the scheduler will compete with other instances for the lock when it is executed. Supported by all databases. |
146
-
|`.pollUsingLockAndFetch(double, double)`| Use polling strategy `lock-and-fetch` which uses `select for update .. skip locked` for less overhead. `lowerLimitFractionOfThreads`: threshold for when new executions are fetched from the database (given that last batch was full). `upperLimitFractionOfThreads`: how many executions to lock and fetch. For high throughput (i.e. keep threads busy), set to for example `1.0, 4.0`. Currently hearbeats are not updated for picked executions in queue. If they stay there for more than 4 * <hearbeat-interval>, they will be marked as dead and likely be unlocked again (determined by `DeadExecutionHandler`). Currently supported by **postgres**. |
147
-
|`.heartbeatInterval(Duration)`| How often to update the heartbeat timestamp for running executions. Default `5m`. |
148
-
|`.schedulerName(SchedulerName)`| Name of this scheduler-instance. The name is stored in the database when an execution is picked by a scheduler. Default `<hostname>`. |
149
-
|`.tableName(String)`| Name of the table used to track task-executions. Change name in the table definitions accordingly when creating the table. Default `scheduled_tasks`. |
150
-
|`.serializer(Serializer)`| Serializer implementation to use when serializing task data. Default standard Java serialization. |
151
-
|`.enableImmediateExecution()`| If this is enabled, the scheduler will attempt to directly execute tasks that are scheduled to `now()`, or a time in the past. For this to work, the call to `schedule(..)` must not occur from within a transaction, because the record will not yet be visible to the scheduler (if this is a requirement, see the method `scheduler.triggerCheckForDueExecutions()`). Default `false`. |
152
-
|`.executorService(ExecutorService)`| If specified, use this externally managed executor service to run executions. Ideally the number of threads it will use should still be supplied (for scheduler polling optimizations). Default `null`. |
153
-
|`.shutdownMaxWait(Duration)`| How long the scheduler will wait before interrupting executor-service threads. If you find yourself using this, consider if it is possible to instead regularly check `executionContext.getSchedulerState().isShuttingDown()` in the ExecutionHandler and abort long-running task. Default `30min`. |
154
-
|`.deleteUnresolvedAfter(Duration)`| The time after which executions with unknown tasks are automatically deleted. These can typically be old recurring tasks that are not in use anymore. This is non-zero to prevent accidental removal of tasks through a configuration error (missing known-tasks) and problems during rolling upgrades. Default `14d`. |
155
-
|`.jdbcCustomization(JdbcCustomization)`| db-scheduler tries to auto-detect the database used to see if any jdbc-interactions need to be customized. This method is an escape-hatch to allow for setting `JdbcCustomizations` explicitly. Default auto-detect. |
156
-
|`.commitWhenAutocommitDisabled(boolean)`| By default no commit is issued on DataSource Connections. If auto-commit is disabled, it is assumed that transactions are handled by an external transaction-manager. Set this property to `true` to override this behavior and have the Scheduler always issue commits. Default `false`. |
157
-
|`.failureLogging(Level, boolean)`| Configures how to log task failures, i.e. `Throwable`s thrown from a task execution handler. Use log level `OFF` to disable this kind of logging completely. Default `WARN, true`. |
158
-
|`.registerShutdownHook()`| Registers a shutdown-hook that will call `Scheduler.stop()` on shutdown. Stop should always be called for a graceful shutdown and to avoid dead executions. |
154
+
#### Consider tuning
155
+
156
+
:gear:`.threads(int)`<br/>
157
+
Number of threads. Default `10`.
158
+
159
+
:gear:`.pollingInterval(Duration)`<br/>
160
+
How often the scheduler checks the database for due executions. Default `10s`.<br/>
161
+
162
+
:gear:`.enableImmediateExecution()`<br/>
163
+
If this is enabled, the scheduler will attempt to directly execute tasks that are scheduled to `now()`, or a time in
164
+
the past. For this to work _reliably_, the call to `schedule(..)` should not occur from within a transaction, because
165
+
the record may not yet be visible to the scheduler (if this is a requirement, see the
0 commit comments