mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: remove duplicate validate calls on same oauth token (#11598)
* chore: remove duplicate validate calls on same oauth token
This commit is contained in:
@ -184,6 +184,9 @@ type Options struct {
|
||||
// under the enterprise license, and can't be imported into AGPL.
|
||||
ParseLicenseClaims func(rawJWT string) (email string, trial bool, err error)
|
||||
AllowWorkspaceRenames bool
|
||||
|
||||
// NewTicker is used for unit tests to replace "time.NewTicker".
|
||||
NewTicker func(duration time.Duration) (tick <-chan time.Time, done func())
|
||||
}
|
||||
|
||||
// @title Coder API
|
||||
@ -208,6 +211,12 @@ func New(options *Options) *API {
|
||||
if options == nil {
|
||||
options = &Options{}
|
||||
}
|
||||
if options.NewTicker == nil {
|
||||
options.NewTicker = func(duration time.Duration) (tick <-chan time.Time, done func()) {
|
||||
ticker := time.NewTicker(duration)
|
||||
return ticker.C, ticker.Stop
|
||||
}
|
||||
}
|
||||
|
||||
// Safety check: if we're not running a unit test, we *must* have a Prometheus registry.
|
||||
if options.PrometheusRegistry == nil && flag.Lookup("test.v") == nil {
|
||||
|
Reference in New Issue
Block a user