- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
4.7.1. Scheduled Jobs Number of Executions
In this chapter, you'll learn how to set a limit on the number of times a scheduled job is executed.
numberOfExecutions Option#
The export configuration object of the scheduled job accepts an optional property numberOfExecutions
. Its value is a number indicating how many times the scheduled job can be executed during the Medusa application's runtime.
For example:
The above scheduled job has the numberOfExecutions
configuration set to 3
.
So, it'll only execute 3 times, each every minute, then it won't be executed anymore.
Note: If you restart the Medusa application, the scheduled job will be executed again until reaching the number of executions specified.
Was this chapter helpful?