fpm-plugin-schedule
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dev
src
test
.babelrc
.gitignore
.npmignore
CHANGELOG.md
README.md
package.json
yarn.lock

README.md

FPM-PLUGIN-SCHEDULE

用于管理定时任务的插件

Install

yarn add fpm-plugin-schedule

Basic Info

  • Run Action Hook Name: BEFORE_SERVER_START
  • ExtendModule Name: job
  • Exception
    • E.Job.JOB_CREATE_ERROR
      const E = {
        Job: {
          JOB_CREATE_ERROR: {
            errno: -10031, 
            code: 'JOB_CREATE_ERROR', 
            message: 'The args should be an object-like'
          }
        }
      }
  • getDependencies()
    • []
  • The Reference Of The Bind() Method An BizModule Object Contains The Belw Functions
    • createCronJob
    • cancelJob(id:Number!)
    • getJobs

Useage

Important

It will create schedule.json after you create anyone job

Handle The Jobs' Result

You can call fpm.subscribe('#cronjob/done'); and the result in data.result You should call fpm.subscribe('#cronjob/error'); and the error in data.error