[server] Increase duration of free trial
This commit is contained in:
@@ -16,8 +16,8 @@ const (
|
||||
FreePlanProductID = "free"
|
||||
// FreePlanTransactionID is the dummy transaction ID for the free plan
|
||||
FreePlanTransactionID = "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 trial
|
||||
TrialPeriod = "days"
|
||||
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 seconds
|
||||
func NMinFromNow(n int64) int64 {
|
||||
return time.Now().Add(time.Minute*time.Duration(n)).UnixNano() / 1000
|
||||
|
||||
Reference in New Issue
Block a user