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

Class RetryTask

packages/bullmq/test/index.test.ts:108–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 let retryCount = 0;
107
108 @Processor('retryTask')
109 class RetryTask implements IProcessor {
110 @MainApp()
111 app: Application;
112
113 async execute(params: any): Promise<void> {
114 retryCount++;
115 if (retryCount < 3) {
116 throw new Error('Simulated failure');
117 }
118 this.app.setAttr('retrySuccess', true);
119 }
120 }
121
122 const app = await createLightApp({
123 imports: [bullmq],

Callers

nothing calls this directly

Calls 2

ProcessorFunction · 0.90
MainAppFunction · 0.90

Tested by

no test coverage detected