jaumard/trailpack-cron

View on GitHub
index.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict'

const Trailpack = require('trailpack')

module.exports = class CronTrailpack extends Trailpack {

  /**
   * Wait Trails ready event to launch jobs
   */
  initialize() {
    this.app.on('trails:ready', () => {
      this.app.services.CronService.init()
    })
    return Promise.resolve()
  }

  constructor(app) {
    super(app, {
      config: require('./config'),
      api: require('./api'),
      pkg: require('./package')
    })
  }
}