Skip to content

Fix invocation of deferred function for loading schema.#5271

Merged
sougou merged 1 commit intovitessio:masterfrom
dasl-:schema-time
Oct 11, 2019
Merged

Fix invocation of deferred function for loading schema.#5271
sougou merged 1 commit intovitessio:masterfrom
dasl-:schema-time

Conversation

@dasl-
Copy link
Member

@dasl- dasl- commented Oct 7, 2019

Golang's defer's arguments are evaluated immediately. Thus the time.Since(start) was being resolved immediately, rather than at the end of function execution.

FYI this changes the times shown in the logs from a few nanoseconds to a few milliseconds in a small test setup.

@dasl- dasl- requested a review from sougou as a code owner October 7, 2019 20:31
Golang's defer's arguments are evaluated immediately. Thus the time.Since(start) was being resolved immediately, rather than at the end of function execution.

Signed-off-by: dleibovic <dleibovic@etsy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants