From 44e6536c4fade0f642e5a804e68861d0b44e6ac4 Mon Sep 17 00:00:00 2001 From: Joerg Lehmann Date: Thu, 15 Sep 2022 18:12:40 +0200 Subject: [PATCH] add payment years to expiration date, not now --- persistence.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/persistence.go b/persistence.go index 7e2f6af..9c9e4df 100644 --- a/persistence.go +++ b/persistence.go @@ -316,11 +316,7 @@ func prolongActivation(deveui string, years int) (string, error) { fmt.Println(t.Unix()) var t_new time.Time - if t.Before(time.Now()) { - t_new = time.Now().AddDate(years, 0, 0) - } else { - t_new = t.AddDate(years, 0, 0) - } + t_new = t.AddDate(years, 0, 0) active_until_new := t_new.Format(layout) // SET object