From c9877879da3947e2e8be21ff23d9fa47df885a6c Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 27 Oct 2022 15:47:26 -0400 Subject: [PATCH] same timezone everywhere --- internal/api/live_activities.go | 2 +- internal/cmd/scheduler.go | 2 +- internal/repository/postgres_live_activity.go | 4 ++-- internal/worker/live_activities.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/api/live_activities.go b/internal/api/live_activities.go index fd8b0d1..c732bef 100644 --- a/internal/api/live_activities.go +++ b/internal/api/live_activities.go @@ -30,7 +30,7 @@ func (a *api) createLiveActivityHandler(w http.ResponseWriter, r *http.Request) } la.RefreshToken = rtr.RefreshToken - la.TokenExpiresAt = time.Now().Add(1 * time.Hour).UTC() + la.TokenExpiresAt = time.Now().Add(1 * time.Hour) if err := a.liveActivityRepo.Create(ctx, la); err != nil { a.errorResponse(w, r, 500, err) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index b7c9cea..0ad7019 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -149,7 +149,7 @@ func enqueueLiveActivities(ctx context.Context, logger *zap.Logger, pool *pgxpoo ctx, cancel := context.WithCancel(ctx) defer cancel() - now := time.Now().UTC() + now := time.Now() next := now.Add(domain.LiveActivityCheckInterval) stmt := `UPDATE live_activities diff --git a/internal/repository/postgres_live_activity.go b/internal/repository/postgres_live_activity.go index 78de83a..0eb0e7e 100644 --- a/internal/repository/postgres_live_activity.go +++ b/internal/repository/postgres_live_activity.go @@ -87,8 +87,8 @@ func (p *postgresLiveActivityRepository) Create(ctx context.Context, la *domain. la.TokenExpiresAt, la.ThreadID, la.Subreddit, - time.Now().UTC(), - time.Now().Add(domain.LiveActivityDuration).UTC(), + time.Now(), + time.Now().Add(domain.LiveActivityDuration), ).Scan(&la.ID) } diff --git a/internal/worker/live_activities.go b/internal/worker/live_activities.go index 25fa2e6..0ed24d9 100644 --- a/internal/worker/live_activities.go +++ b/internal/worker/live_activities.go @@ -138,7 +138,7 @@ func (lac *liveActivitiesConsumer) Consume(delivery rmq.Delivery) { ctx, cancel := context.WithCancel(lac) defer cancel() - now := time.Now().UTC() + now := time.Now() defer func() { elapsed := time.Now().Sub(now).Milliseconds() _ = lac.statsd.Histogram("apollo.consumer.runtime", float64(elapsed), []string{"queue:live_activities"}, 0.1)