Skip to content

Instantly share code, notes, and snippets.

@gbelot2003
Created July 22, 2019 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbelot2003/a2366a25dd12f56083f23ac6bea2be12 to your computer and use it in GitHub Desktop.
Save gbelot2003/a2366a25dd12f56083f23ac6bea2be12 to your computer and use it in GitHub Desktop.
Funcion de envio de post acada x tiempo
(function schedule() {
background.asyncStuff().then(function() {
console.log('Process finished, waiting 5 minutes');
setTimeout(function() {
console.log('hacer post cada 5 minutos');
this.post("/url/para/ejecutar/logs")
}, 1000 * 60 * 5);
}).catch(err => console.error('error in scheduler', err));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment