Created
October 16, 2018 19:08
-
-
Save aguileraq/229ebc689472d3e5eb51417581512123 to your computer and use it in GitHub Desktop.
example cron
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var runCronCorteEmpresa = new CronJob({ | |
cronTime: '00 00 00 * * 0-6', | |
onTick: function() { | |
mongoose.connect('mongodb://heroku_g0l82g29:h3t4299755taqigahev14nnp1k@ds121906.mlab.com:21906/heroku_g0l82g29', { useNewUrlParser: true }) | |
.then( async () => { | |
debugS('Conectado a la base de datos') | |
const result = await run(); | |
disconnect(result); | |
}) | |
.catch(err => { debugF('Algo salio mal', err ); disconnect(); }); | |
}, | |
start: false, | |
timeZone: 'America/Mexico_City' | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment