From 7630af8316531cf62b791d0c279a763fc27a158b Mon Sep 17 00:00:00 2001 From: Idhibhat Pankam Date: Mon, 22 Jul 2024 21:11:34 +0700 Subject: [PATCH] check reg time --- internal/group/group.handler.go | 3 +++ internal/selection/selection.handler.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/internal/group/group.handler.go b/internal/group/group.handler.go index f50ce6f..855b98c 100644 --- a/internal/group/group.handler.go +++ b/internal/group/group.handler.go @@ -339,6 +339,9 @@ func (h *handlerImpl) checkRegTime() bool { if nowGMTPlus7.Before(h.regConf.RpkmStart) { h.log.Named("checkRegTime").Warn("Forbidden: Registration hasn't started") return false + } else if nowGMTPlus7.After(h.regConf.RpkmEnd) { + h.log.Named("checkRegTime").Warn("Forbidden: Registration has ended") + return false } return true diff --git a/internal/selection/selection.handler.go b/internal/selection/selection.handler.go index a3a7f13..361f949 100644 --- a/internal/selection/selection.handler.go +++ b/internal/selection/selection.handler.go @@ -283,6 +283,9 @@ func (h *handlerImpl) checkRegTime() bool { if nowGMTPlus7.Before(h.regConf.RpkmStart) { h.log.Named("checkRegTime").Warn("Forbidden: Registration hasn't started") return false + } else if nowGMTPlus7.After(h.regConf.RpkmEnd) { + h.log.Named("checkRegTime").Warn("Forbidden: Registration has ended") + return false } return true