From 02e7125e093bb7a45ce6da67acbbde1ec6c40572 Mon Sep 17 00:00:00 2001 From: Rafael Claudio Date: Thu, 14 Sep 2023 20:52:07 -0300 Subject: [PATCH] fixes 2088, for timezones behind UTC, the current code would convert for one day before (local time) when add a day, what would result in the same day after converting back to UTC and thus generating an infinite loop --- .../services/data-gathering/data-gathering.processor.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/api/src/services/data-gathering/data-gathering.processor.ts b/apps/api/src/services/data-gathering/data-gathering.processor.ts index c517e0f15..301891922 100644 --- a/apps/api/src/services/data-gathering/data-gathering.processor.ts +++ b/apps/api/src/services/data-gathering/data-gathering.processor.ts @@ -102,14 +102,7 @@ export class DataGatheringProcessor { } // Count month one up for iteration - currentDate = new Date( - Date.UTC( - getYear(currentDate), - getMonth(currentDate), - getDate(currentDate) + 1, - 0 - ) - ); + currentDate.setDate(currentDate.getDate() + 1); } await this.marketDataService.updateMany({ data });