Created
July 29, 2021 10:03
-
-
Save bibhuticoder/dd7add09a40b2f9b64652058e62b2398 to your computer and use it in GitHub Desktop.
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
import cron from 'node-cron'; | |
import instaRefreshCron from "./crons/instaRefresh.cron"; | |
// run immediately after server starts | |
instaRefreshCron(); | |
// refresh instaAccessToken eg: weekly(every Sat) | |
cron.schedule('* * * * * 7', async () => { | |
await instaRefreshCron(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment