function test() {
db.test.findOne({id: 1},)
.then(res => {
if (!res)
return Promise.reject('Period backup not found');
let job = cron.schedule(res.cronTime, function () {
test1();
});
console.log(job)
})
}
cron.schedule('* * * * *', () =>
test();
return true;
});