- Notifications
You must be signed in to change notification settings - Fork1k
refactor(coderd/provisionerdserver): use quartz.Clock instead of TimeNowFn#15642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
func (s*server)timeNow(tags...string) time.Time { | ||
returndbtime.Time(s.Clock.Now(tags...)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nice 👍
ifoptions.Clock==nil { | ||
options.Clock=quartz.NewReal() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍 Even ifapi.Clock
isnil
for some reason this should keep us covered.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hell yeah
0896f33
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Relates to#15082 (comment) (and#15594)
For testing the autostart change in the linked PR we need to have control over time in the
provisionerdserver
. Currently that is possible with aTimeNowFn
but this wasn't hooked up tocoderd
. This PR replacesTimeNowFn
inprovisionerdserver
withquartz.Clock
as well as passescoderd
'sClock
toprovisionerdserver
.