Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
docs(media): list the shutdown 503 on the convert routes
Yudhi Armyndharisc408c9ddb692
diff --git a/src/modules/media/media.controller.spec.ts b/src/modules/media/media.controller.spec.tsindex 983ebd473..900c56ee6 100644--- a/src/modules/media/media.controller.spec.ts+++ b/src/modules/media/media.controller.spec.ts@@ -90,4 +90,14 @@ describe('MediaController', () => {await expect(controller.conversionStatus()).resolves.toEqual({ available: true });});});+ describe('documented responses', () => {+ // A conversion that arrives, or is parked, after shutdown began answers 503 as well.+ it.each(['convertVoice', 'convertVideo'] as const)('%s documents the shutdown 503', name => {+ const responses = Reflect.getMetadata('swagger/apiResponse', handler(name)) as Record<+ string,+ { description: string }+ >;+ expect(responses['503'].description).toMatch(/shutting down/);+ });+ });});diff --git a/src/modules/media/media.controller.ts b/src/modules/media/media.controller.tsindex 2ce1e5ee4..17c64909e 100644--- a/src/modules/media/media.controller.ts+++ b/src/modules/media/media.controller.ts@@ -62,6 +62,7 @@ export class MediaController {status: 503,description:'Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly. ' ++ 'It also answers 503 once the gateway is shutting down. ' +MEDIA_URL_PROXY_503,})async convertVoice(@Param('sessionId') sessionId: string, @Body() dto: ConvertMediaDto) {@@ -90,6 +91,7 @@ export class MediaController {status: 503,description:'Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly. ' ++ 'It also answers 503 once the gateway is shutting down. ' +MEDIA_URL_PROXY_503,})async convertVideo(@Param('sessionId') sessionId: string, @Body() dto: ConvertMediaDto) {