Back: Functionality
The launch of the jobs in schedule is performed in two ways.:
- in a separate process using the
bin/schedule.js
script - within the ION web application process (bin / www) by specifying in the ini-file this option -
jobs.enabled=true
In the second case, job management is possible to implement in a web application.
Jobs are configured in the deploy.json
file of the applications in the global settings section as a jobs parameter.
"jobs": {
"dummy": {
"launch": { // The frequency of launching the job
"month": [2,5], // in February and May
"week": 3, // every third week (month and week - mutually exclusive settings),
"weekday": [1, 3, 5], // on Mondays, Wednesdays and Fridays
"dayOfYear": 5, // every 5 days during the year,
"day": 10, // every 10 days during the month
"hour": 3, // every 3 hours
"minute": [10, 15, 35], // on the 10th, 15th and 35th minute
"sec": 10 // every 10 seconds
},
"di": { // scope of the job
"dummy": {
"module": "applications/develop-and-test/jobs/dummy",
"options": {
}
}
},
"worker": "dummy", // the name of the component from the job scope that will be executed
}
}
A component can be specified as a starting job, in which case it should have the run
method. A function can also be specified as a starting job. Шn di it is described in the same way as the component, but using the executable
parameter:
"di": {
"dummy": {
"executable": "applications/develop-and-test/jobs/dummy",
"options": {}
}
}
The jobs field in the global settings.
...
"jobs": {
"dummy": {
"launch": {
"sec": 30
},
"worker": "dummy",
"di": {
"dummy": {
"executable": "applications/develop-and-test/jobs/dummy"
}
}
}
...
Copyright (c) 2018 LLC "ION DV".
All rights reserved.