Searching.ton
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
747 B

2 years ago
import dotenv from "dotenv"
import path from "path"
dotenv.config({ path: path.resolve(__dirname, "../.env.local") })
2 years ago
import domainWatcher from "./domain-watcher"
import parser from "./parser"
import influx from "./influx"
2 years ago
const run = async()=>{
2 years ago
console.log('Start domain watcher')
console.time('watcher')
await domainWatcher();
console.timeEnd('watcher')
2 years ago
influx()
console.log('Start parser');
console.time('watcher');
await parser();
console.timeEnd('watcher');
2 years ago
2 years ago
}
2 years ago
const second = 1000
const minute = 60 * second
const hour = 60 * minute
2 years ago
2 years ago
run()
2 years ago
2 years ago
setInterval(() => {
console.log(new Date(), "Health check")
}, hour)
2 years ago
2 years ago
setInterval(() => {
console.log(new Date(), "Cron parse start")
run()
}, 3 * hour)