MCPcopy
hub / github.com/midwayjs/midway / ProgressTask

Class ProgressTask

packages/bullmq/test/index.test.ts:199–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197 let progressValue = 0;
198
199 @Processor('progressTask')
200 class ProgressTask implements IProcessor {
201 @MainApp()
202 app: Application;
203
204 @Inject()
205 ctx: Context;
206
207 async execute(params: any, job: Job): Promise<void> {
208 assert(job === this.ctx.job);
209 for (let i = 0; i <= 100; i += 20) {
210 await job.updateProgress(i);
211 await sleep(100);
212 }
213 this.app.setAttr('finalProgress', job.progress);
214 }
215 }
216
217 const app = await createLightApp({
218 imports: [bullmq],

Callers

nothing calls this directly

Calls 3

ProcessorFunction · 0.90
MainAppFunction · 0.90
InjectFunction · 0.90

Tested by

no test coverage detected