fix: stop reporting future licenses as errors (#14492)

This commit is contained in:
Spike Curtis
2024-09-03 09:22:46 +04:00
committed by GitHub
parent 5bd5801286
commit 4eac2acede
3 changed files with 33 additions and 0 deletions

View File

@ -199,6 +199,13 @@ func (opts *LicenseOptions) Valid(now time.Time) *LicenseOptions {
return opts
}
func (opts *LicenseOptions) FutureTerm(now time.Time) *LicenseOptions {
opts.NotBefore = now.Add(time.Hour * 24)
opts.ExpiresAt = now.Add(time.Hour * 24 * 60)
opts.GraceAt = now.Add(time.Hour * 24 * 53)
return opts
}
func (opts *LicenseOptions) UserLimit(limit int64) *LicenseOptions {
return opts.Feature(codersdk.FeatureUserLimit, limit)
}