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' }; + } } /** 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: