π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[server] Increase duration of free trial
Neeraj Guptac416819f0a92
diff --git a/server/ente/billing.go b/server/ente/billing.goindex 111d0847e7..0aa8faf2c4 100644--- a/server/ente/billing.go+++ b/server/ente/billing.go@@ -16,8 +16,8 @@ const (FreePlanProductID = "free"// FreePlanTransactionID is the dummy transaction ID for the free planFreePlanTransactionID = "none"- // TrialPeriodDuration is the duration of the free trial- TrialPeriodDuration = 365+ // TrialPeriodDuration is the duration (in years) of the free trial+ TrialPeriodDuration = 100// TrialPeriod is the unit for the duration of the free trialTrialPeriod = "days"diff --git a/server/pkg/utils/billing/billing.go b/server/pkg/utils/billing/billing.goindex d5f5f57057..e6e0e6a718 100644--- a/server/pkg/utils/billing/billing.go+++ b/server/pkg/utils/billing/billing.go@@ -108,7 +108,7 @@ func GetFreeSubscription(userID int64) ente.Subscription {ProductID: ente.FreePlanProductID,OriginalTransactionID: ente.FreePlanTransactionID,Storage: ente.FreePlanStorage,- ExpiryTime: time.NDaysFromNow(ente.TrialPeriodDuration),+ ExpiryTime: time.NYearsFromNow(ente.TrialPeriodDuration),}}diff --git a/server/pkg/utils/time/time.go b/server/pkg/utils/time/time.goindex a07df4b262..b4fda7f68b 100644--- a/server/pkg/utils/time/time.go+++ b/server/pkg/utils/time/time.go@@ -48,6 +48,10 @@ func NDaysFromNow(n int) int64 {return time.Now().AddDate(0, 0, n).UnixNano() / 1000}+func NYearsFromNow(n int) int64 {+ return time.Now().AddDate(n, 0, 0).UnixNano() / 1000+}+// NMinFromNow returns the time n min from now in micro secondsfunc NMinFromNow(n int64) int64 {return time.Now().Add(time.Minute*time.Duration(n)).UnixNano() / 1000