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.

31 lines
703 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'
const run = async()=>{
console.log('Start domain watcher')
2 years ago
console.time('watcher')
2 years ago
await domainWatcher();
2 years ago
console.timeEnd('watcher')
console.log('Start parser');
console.time('watcher');
2 years ago
await parser();
2 years ago
console.timeEnd('watcher');
2 years ago
}
const second = 1000;
const minute= 60 * second;
const hour = 60 * minute;
run();
setInterval(()=>{
2 years ago
console.log(new Date(), 'Health check');
},hour)
setInterval(()=>{
console.log(new Date(), 'Cron parse start')
2 years ago
run()
},3 * hour)