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
| withName |`name: string`| yes || The name of the job. Used as a unique identifier. |
108
-
| withSchedule |`interval: number \| string`, `firstRunAfter: number \| string` (default: `0`) | no || Either this setter or `withCronSchedule()` must be called. Specifies the schedule for starting the job. Time intervals can be given in human-readable formats (like '1 minute', 'ten days', 'twenty-one days and 2 hours' or 'never') or in milliseconds. Check the documentation of [ human-interval ](https://www.npmjs.com/package/human-interval) for details. A job with interval 'never' will not be started to run periodically but needs to be run explicitly. If the job never ran before, the job will run after `firstRunAfter` for the first time. Just like the `interval`, `firstRunAfter` can also be given in a human-readable format or as milliseconds. The maximum value for both `interval` and `firstRunAfter` is 2147483647 ms (or its human readable equivalents). |
109
-
| withCronSchedule |`cronSchedule: string`| no || Either this setter or `withCronSchedule()` must be called. Specifies the cron schedule according to which the job will run. See https://www.npmjs.com/package/cron#cron-ranges for the allowed cron ranges. |
110
-
| withConcurrency |`concurrency: number`| no | 1 | How many instances of a job are started at a time. |
111
-
| withMaxRunning |`maxRunning: number`| no | 0 | Maximum number of job executions that is allowed at a time. Set to 0 for no max. The schedule will trigger no more job executions if maxRunning is reached. |
112
-
| withHandler |`handler: function`| yes || The function to execute. |
113
-
| withTimeout |`timeout: number`| no || The timeout for the executed function. If a mongo error occurs during job execution and timeout is defined, the job will be stopped and automatically restarted after `timeout` ms to recover from the error. If no timeout is specified, momo might end up in an error state (not executing the affected job correctly anymore) that requires a manual restart. |
114
-
| withParameters |`jobParameters: JobParameters`| no || The parameters the `handler` function is called with. |
| withName |`name: string`| yes || The name of the job. Used as a unique identifier. |
108
+
| withSchedule |`interval: number \| string`, `firstRunAfter: number \| string` (default: `0`) | no || Either this setter or `withCronSchedule()` must be called. Specifies the schedule for starting the job. Time intervals can be given in human-readable formats (like '1 minute', 'ten days', 'twenty-one days and 2 hours' or 'never') or in milliseconds. Check the documentation of [ human-interval ](https://www.npmjs.com/package/human-interval) for details. A job with interval 'never' will not be started to run periodically but needs to be run explicitly. If the DB holds no record of a job with the same name running before, the job will run after `firstRunAfter` for the first time. Just like the `interval`, `firstRunAfter` can also be given in a human-readable format or as milliseconds. The maximum value for both `interval` and `firstRunAfter` is 2147483647 ms (or its human readable equivalents). On jobs with interval 'never', any value passed for `firstRunAfter` is ignored. |
109
+
| withCronSchedule |`cronSchedule: string`| no || Either this setter or `withCronSchedule()` must be called. Specifies the cron schedule according to which the job will run. See https://www.npmjs.com/package/cron#cron-ranges for the allowed cron ranges. |
110
+
| withConcurrency |`concurrency: number`| no | 1 | How many instances of a job are started at a time. |
111
+
| withMaxRunning |`maxRunning: number`| no | 0 | Maximum number of job executions that is allowed at a time. Set to 0 for no max. The schedule will trigger no more job executions if maxRunning is reached. |
112
+
| withHandler |`handler: function`| yes || The function to execute. |
113
+
| withTimeout |`timeout: number`| no || The timeout for the executed function. If a mongo error occurs during job execution and timeout is defined, the job will be stopped and automatically restarted after `timeout` ms to recover from the error. If no timeout is specified, momo might end up in an error state (not executing the affected job correctly anymore) that requires a manual restart. |
114
+
| withParameters |`jobParameters: JobParameters`| no || The parameters the `handler` function is called with. |
0 commit comments