Skip to content

Instantly share code, notes, and snippets.

@antonkalik
Created March 10, 2024 00:06
Show Gist options
  • Save antonkalik/0b70326a5847f4895da3ddeb9a4d8c58 to your computer and use it in GitHub Desktop.
Save antonkalik/0b70326a5847f4895da3ddeb9a4d8c58 to your computer and use it in GitHub Desktop.
Cron job for refreshConfiguration
import cron from 'node-cron''
import { TokenService } from 'src/services/TokenService'
cron.schedule('0 * * * *', () => {
TokenService.refreshConfiguration();
}, {
scheduled: true,
timezone: "America/New_York"
});
console.log('Cron job scheduled to refresh TokenService configuration every hour.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment