From 17019cecfbbc94e15cabab3941b5e2b2578681d2 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Sat, 7 May 2022 12:05:47 -0400 Subject: [PATCH] fix grace period expiry check --- internal/repository/postgres_device.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/repository/postgres_device.go b/internal/repository/postgres_device.go index 64310b2..08c255c 100644 --- a/internal/repository/postgres_device.go +++ b/internal/repository/postgres_device.go @@ -93,7 +93,7 @@ func (p *postgresDeviceRepository) GetInboxNotifiableByAccountID(ctx context.Con INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id WHERE devices_accounts.account_id = $1 AND devices_accounts.inbox_notifiable = TRUE AND - grace_period_until > EXTRACT(EPOCH FROM NOW())` + grace_period_expires_at > NOW()` return p.fetch(ctx, query, id) } @@ -105,7 +105,7 @@ func (p *postgresDeviceRepository) GetWatcherNotifiableByAccountID(ctx context.C INNER JOIN devices_accounts ON devices.id = devices_accounts.device_id WHERE devices_accounts.account_id = $1 AND devices_accounts.watcher_notifiable = TRUE AND - grace_period_until > EXTRACT(EPOCH FROM NOW())` + grace_period_expires_at > NOW()` return p.fetch(ctx, query, id) }