fix: use manual res.json() in getNextJob to prevent double-response on 204
Build and Push Multi-Platform Images / build-and-push (push) Successful in 31s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 31s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,19 +60,19 @@ export class LabelPrintAgentController {
|
|||||||
|
|
||||||
// Agent: nächsten Job abholen (Polling)
|
// Agent: nächsten Job abholen (Polling)
|
||||||
@Get('jobs/next')
|
@Get('jobs/next')
|
||||||
async getNextJob(@Query('agentId') agentId: string, @Res({ passthrough: true }) res: Response) {
|
async getNextJob(@Query('agentId') agentId: string, @Res() res: Response) {
|
||||||
const job = await this.service.claimNextJob(agentId ?? 'unknown');
|
const job = await this.service.claimNextJob(agentId ?? 'unknown');
|
||||||
if (!job) {
|
if (!job) {
|
||||||
res.status(HttpStatus.NO_CONTENT).send();
|
res.status(HttpStatus.NO_CONTENT).send();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return {
|
res.status(HttpStatus.OK).json({
|
||||||
jobId: String(job.Id),
|
jobId: String(job.Id),
|
||||||
labelImageBase64: job.LabelImageData ? job.LabelImageData.toString('base64') : null,
|
labelImageBase64: job.LabelImageData ? job.LabelImageData.toString('base64') : null,
|
||||||
labelImageContentType: 'image/png',
|
labelImageContentType: 'image/png',
|
||||||
labelWidthMm: job.LabelWidthMm,
|
labelWidthMm: job.LabelWidthMm,
|
||||||
labelHeightMm: job.LabelHeightMm,
|
labelHeightMm: job.LabelHeightMm,
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Agent: Bild separat abrufen
|
// Agent: Bild separat abrufen
|
||||||
|
|||||||
Reference in New Issue
Block a user