Skip to content

GrandlineX/bundle-cron

Repository files navigation

GrandLineX Cron Bundle

Cron support for GrandLineX

Description

img

GrandLineX is an out-of-the-box server framework.

GitHub NPM TS

Status

Quality Gate Status Security Rating Maintainability Rating Reliability Rating Coverage

Issues

Bugs Vulnerabilities Code Smells

Install

Example

class TestKernel extends CoreKernel<any> {
  constructor(appName:string, appCode:string) {
    super( { appName, appCode});
    
    // ...

      /** 
       * Add the module to the kernel
       */
      
      this.addModule(new CronModule(this));

      /**
       * Define kernel event
       */
      
      this.on("test-trigger",()=>{
          console.log("test-trigger");
      })
      
      /**
       * Add cron timer
       */
      const mod = kernel.getChildModule('cron') as CronModule;
     
      const client = mod.getClient() as CronClient;
       client.registerCron({
          trigger: 'test-trigger',
          name: 'test',
          cron: '0 * * * *',
      });
  }
}

Documentation

About

Cron task support GrandlineX using node-con

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published