diff --git a/apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts b/apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts new file mode 100644 index 000000000..3c316720f --- /dev/null +++ b/apps/api/src/services/queues/statistics-gathering/interfaces/interfaces.ts @@ -0,0 +1,7 @@ +export interface BetterStackUptimeSlaResponse { + data: { + attributes: { + availability: number; + }; + }; +} diff --git a/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts b/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts index 82f362d25..b64efaad8 100644 --- a/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts +++ b/apps/api/src/services/queues/statistics-gathering/statistics-gathering.processor.ts @@ -25,6 +25,8 @@ import { Injectable, Logger } from '@nestjs/common'; import * as cheerio from 'cheerio'; import { format, subDays } from 'date-fns'; +import { BetterStackUptimeSlaResponse } from './interfaces/interfaces'; + @Injectable() @Processor(STATISTICS_GATHERING_QUEUE) export class StatisticsGatheringProcessor { @@ -225,7 +227,7 @@ export class StatisticsGatheringProcessor { ) } ) - .then((res) => res.json()); + .then((res) => res.json()); return data.attributes.availability / 100; } catch (error) {