-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathldes-client.js
49 lines (39 loc) · 1.37 KB
/
ldes-client.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
42
43
44
45
46
47
48
49
import {
fetchObjectLDES,
fetchThesaurusLDES,
fetchPersonenLDES,
fetchExhibitionLDES,
fetchArchiveLDES,
fetchPrivateObjectsLDES,
} from "./utils/ldes_harvester.js";
import cron from "node-cron";
function main() {
console.log("----------------------------------------------------------");
console.log(" start sync LDES-postGres ");
console.log(" ");
console.log("----------------------------------------------------------");
try {
console.log("fetching human made objects");
fetchObjectLDES();
console.log("fetching thesaurus");
fetchThesaurusLDES();
console.log("fetching exhibition");
fetchExhibitionLDES();
console.log("fetching agents");
fetchPersonenLDES();
fetchArchiveLDES();
console.log("done harvesting LDES");
fetchPrivateObjectsLDES();
console.log("done fetching private objects");
} catch (e) {
console.log(e);
}
console.log("----------------------------------------------------------");
console.log(" finished sync LDES-postGres ");
console.log(" ");
console.log("----------------------------------------------------------");
}
// run this script every day at 23:00
cron.schedule("0 23 * * *", () => {
main();
});