1.0.3 • Published 5 years ago

egg-schedule-custom v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

egg-schedule-custom

An egg schedule based on egg-schedule,which allowed to assign schedule workers.

Install

npm install egg-schedule-custom

Usage

Add Pluin config to {app_root}/config/pluin.js.

schedule: {
    enable: true,
    package: 'egg-schedule-custom'
}

Then you could use it to defined your job:

// {app_root}/app/schedule/test.js
module.exports = {
    schedule: {
        interval: '2s',
        type: 'custom',
        immediate: true,
        disable: true,
        workerNum: 2,
        env: ['local'],
    },
    async task(ctx) {
        console.log('test success!');
    },
};

Full usage see egg-schedule.