From d0cfa0fb7cca1433279c3b74001186f391727ff0 Mon Sep 17 00:00:00 2001 From: cristianpb Date: Wed, 25 Aug 2021 22:36:56 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=85=20Add=20healthcheck=20for=20bulk?= =?UTF-8?q?=20chunk=20queue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/controllers/status.controller.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/backend/src/controllers/status.controller.ts b/backend/src/controllers/status.controller.ts index c0c32386..13d340e2 100644 --- a/backend/src/controllers/status.controller.ts +++ b/backend/src/controllers/status.controller.ts @@ -1,5 +1,6 @@ import { Controller, Get, Route, Response, Tags } from 'tsoa'; import { HealthcheckResponse } from '../models/result'; +import { processChunk } from '../processStream'; /** * @swagger @@ -17,8 +18,19 @@ export class StatusController extends Controller { @Response('200', 'OK') @Tags('Check') @Get('/healthcheck') - public msg(): HealthcheckResponse { - return { msg: 'OK' }; + public async msg(): Promise { + const result = await processChunk( + [{firstName: 'jean', lastName: 'pierre', birthDate: '04/08/1933'}], + 5, + { + dateFormat: 'dd/MM/yyyy', + } + ) + if (result.length > 0 && result[0].length > 0 && result[0][0].sex ) { + return { msg: 'OK' }; + } else { + return { msg: 'KO' }; + } } /** From f8bdc5bec3a849b5a9b9fcd04ec124365072f59f Mon Sep 17 00:00:00 2001 From: cristianpb Date: Wed, 25 Aug 2021 22:37:38 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=85=20Add=20healthcheck=20for=20redis?= =?UTF-8?q?=20container?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index ab916008..964e98b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,7 +60,11 @@ services: container_name: ${APP}-redis volumes: - ${REDIS_DATA}:/data - + healthcheck: + test: ["CMD", "redis-cli","ping"] + interval: 1m + timeout: 10s + retries: 3 networks: default: