From 8dae98db2bc01e656c7a632e3dc278ad4de18998 Mon Sep 17 00:00:00 2001 From: maximo tejeda Date: Fri, 13 Dec 2024 11:12:34 -0400 Subject: [PATCH] fix timing issue --- Dockerfile | 1 + internal/helpers/timehelpers.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index db80f07..5d203d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,5 @@ WORKDIR /app COPY --from=builder /app/bin/us-dop-api /usr/bin/ COPY --from=builder /app/assets/ /app/assets/ RUN apk add --no-cache tzdata + ENTRYPOINT /usr/bin/us-dop-api diff --git a/internal/helpers/timehelpers.go b/internal/helpers/timehelpers.go index 2c4aa1b..1c134a1 100644 --- a/internal/helpers/timehelpers.go +++ b/internal/helpers/timehelpers.go @@ -14,13 +14,13 @@ func ParseTimeAmount(timeFrame, timeAmount string) (timeSearch time.Duration, er switch timeFrame { case "hour": - timeSearch = 60 * 1 * time.Duration(timeInt) * time.Hour + timeSearch = time.Duration(timeInt) * time.Hour case "day": - timeSearch = 60 * 24 * time.Duration(timeInt) * time.Hour + timeSearch = 24 * time.Duration(timeInt) * time.Hour case "week": - timeSearch = (60 * 24 * 7 * time.Duration(timeInt)) * time.Hour + timeSearch = (24 * 7 * time.Duration(timeInt)) * time.Hour case "month": - timeSearch = (60 * 24 * 7 * 4) * time.Hour + timeSearch = (24 * 7 * 4) * time.Hour default: } return timeSearch, err