| 15 | describe(`/test/index.test.ts`, () => { |
| 16 | it('test auto repeat processor', async () => { |
| 17 | @Processor('HelloTask', { |
| 18 | repeat: { |
| 19 | pattern: FORMAT.CRONTAB.EVERY_PER_5_SECOND |
| 20 | } |
| 21 | }) |
| 22 | class HelloTask implements IProcessor { |
| 23 | @MainApp() |
| 24 | app: Application; |
| 25 | |
| 26 | async execute() { |
| 27 | this.app.setAttr(`task`, 'task'); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | @Processor('concurrency', {}, { limiter: { max: 3, duration: 1000 }, concurrency: 3 }) |
| 32 | class QueueTask { |