-
Notifications
You must be signed in to change notification settings - Fork 0
/
jobs.config
66 lines (59 loc) · 1.97 KB
/
jobs.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*******************
backend/jobs.config
*******************
'backend/jobs.config' is a Velo configuration file that lets you schedule code to run repeatedly at specified intervals.
Using scheduled jobs you can run backend code without any user interaction. For example, you could generate a weekly
report or run nightly data cleansing.
You schedule code to run by creating a job.
Each job defines which function to run and when to run it.
---
More about Scheduled Jobs:
https://support.wix.com/en/article/velo-scheduling-recurring-jobs
Online tool for building Velo cron expressions
https://wix.to/NDAQn6c
*******************/
// The following code is an example of a job. Adapt the code for your specific use case.
{
"jobs": [
{
"functionLocation": "/module/functions.jsw",
"functionName": "fetchProducts",
"description": "Fetch products from the external source",
"executionConfig": {
"cronExpression": "0 * * * *"
}
},
{
"functionLocation": "/module/functions.jsw",
"functionName": "assignImagesToProduct",
"description": "Add images to wix-store products",
"executionConfig": {
"cronExpression": "2 * * * *"
}
},
{
"functionLocation": "/module/functions.jsw",
"functionName": "assignProductsToCollections",
"description": "Add products to wix-store collections",
"executionConfig": {
"cronExpression": "3 * * * *"
}
},
{
"functionLocation": "/module/functions.js",
"functionName": "updateProductInventory",
"description": "Add products invantory quantity",
"executionConfig": {
"cronExpression": "4 * * * *"
}
},
{
"functionLocation": "/module/functions.js",
"functionName": "updateProductsDescription",
"description": "Update product name, price and description if it updated on external source",
"executionConfig": {
"cronExpression": "5 * * * *"
}
}
]
}