-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresolver.js
41 lines (32 loc) · 1.08 KB
/
resolver.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
36
37
38
39
40
41
import { monitorHealthUpstream } from "./utils/tests.js";
import cron from "node-cron";
import {populateIIIF, produceURIs} from "./utils/produceURIs.js";
function main() {
console.log("---------------------");
console.log("BOOTING UP HEALTH CHECK - RESOLVER");
console.log("---------------------");
// CHECK FOR DUPLICATES
// todo: https://www.phind.com/search?cache=yxa4xegiuml3tvo0ljz3sngl
// CHECK RECORDS
// scan only UNKNOWN objects (daily at 00:00)
cron.schedule("0 00 * * *", () => {
monitorHealthUpstream("UNKNOWN");
console.log("ONLY CHECKING OBJECTS WITH STATUS: UNKNOWN");
});
// scan only UNHEALTHY objects (daily at 01:00)
cron.schedule("1 00 * * 7", () => {
monitorHealthUpstream("UNHEALTHY");
console.log("ONLY CHECKING OBJECTS WITH STATUS: UNHEALTHY");
});
// full scan (only once per week - 02:00 on friday)
cron.schedule("0 0 * * 6", () => {
monitorHealthUpstream("ALL");
console.log("SCANNING ALL OBJECTS - FULL CHECK");
});
}
// start script
// test
//populateIIIF()
//monitorHealthUpstream("ALL");
//produceURIs();
main();