Skip to content

Instantly share code, notes, and snippets.

@bibhuticoder
Created July 29, 2021 10:03
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 bibhuticoder/dd7add09a40b2f9b64652058e62b2398 to your computer and use it in GitHub Desktop.
Save bibhuticoder/dd7add09a40b2f9b64652058e62b2398 to your computer and use it in GitHub Desktop.
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