Created
January 21, 2022 00:51
-
-
Save brotoo25/b316ec0f7f35e6d1790a83e68f97a64c to your computer and use it in GitHub Desktop.
Node Cron Sample
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
// package.json | |
"dependencies": { | |
"node-cron": "^3.0.0" | |
} | |
// code.js | |
const cron = require('node-cron') | |
// Run currency refresh every 30 minutes | |
cron.schedule('*/30 * * * *', () => { | |
refreshDatabase() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment