koatty_schedule
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

koatty_schedule

Schedule for koatty.

Koatty框架的 Scheduled, SchedulerLock, Lock 支持库

Usage

db.ts in koatty project:

export default {
    ...

    "CacheStore": {
        type: "memory", // redis or memory, memory is default
        // key_prefix: "koatty",
        // host: '127.0.0.1',
        // port: 6379,
        // name: "",
        // username: "",
        // password: "",
        // db: 0,
        // timeout: 30,
        // pool_size: 10,
        // conn_timeout: 30
    },

    ...
};

used in service:

import { Scheduled, SchedulerLock } from "koatty_schedule";

export class TestService {

    @Scheduled("0 * * * * *")
    @SchedulerLock("testCron") //locker
    Test(){
        //todo
    }
}

Dependents (0)

Package Sidebar

Install

npm i koatty_schedule

Weekly Downloads

5

Version

2.0.1

License

BSD-3-Clause

Unpacked Size

41.2 kB

Total Files

11

Last publish

Collaborators

  • richenlin