-
Notifications
You must be signed in to change notification settings - Fork 0
/
updateDaily.js
35 lines (31 loc) · 887 Bytes
/
updateDaily.js
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
// Update everything every day
function updateDaily() {
console.log("Starting updateDaily!");
// Load shared variables
console.log("Loading shared variables");
try {
assignVariables();
} catch (e) {
console.log("Failed to assign variables: " + e.toString());
}
// Delete all triggers
console.log("Deleting all triggers");
try {
deleteTriggers();
} catch (e) {
console.log("Failed to do delete triggers: " + e.toString());
}
// Schedule next triggers
console.log("Scheduling next triggers");
try {
createTriggerForTime(getNextCronTriggerTime(UPDATE_DAILY_CRONS), 'updateDaily');
} catch (e) {
console.log("Failed to create next updateDaily: " + e.toString());
}
try {
createNextUpdateStatusTrigger();
} catch (e) {
console.log("Failed to create next updateStatus: " + e.toString());
}
console.log("All done!")
}