jaumard/trailpack-cron

View on GitHub
archetype/config/cron.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Cron Configuration
 * (app.config.cron)
 *
 * Configure cron tasks
 *
 * @see {@link https://github.com/jaumard/trailpack-cron}
 */
module.exports = {
  defaultTimeZone: 'Europe/Paris', // Default timezone use for tasks
  jobs: {
    myJob: {
      schedule: '* * * * * *',
      onTick: app => {
        app.log.info('I am ticking')
      },
      onComplete: app => {
        app.log.info('I am done')
      },
      start: true, // Start task immediately
      timezone: 'Europe/Paris' // Custom timezone
    }
  }
}