Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5b08f8b

Browse files
authored
fix: change createWorkspace to use dbtime.Time (#19414)
The `createWorkspace` function was updated to use an injected Clock,which makes it possible to mock time in tests:https://github.com/coder/coder/pull/19264/files#diff-46f90baab52ea3ad914acbde30d656dbc8e46f5918d19bc056c445a1dc502482R1130For database operations, however, it is recommended to use `dbtime.Time`since it rounds to the microsecond, the smallest unit of precisionsupported by Postgres.
1 parent1a601c3 commit5b08f8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎coderd/workspaces.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ func createWorkspace(
636636
)
637637

638638
// Use injected Clock to allow time mocking in tests
639-
now:=api.Clock.Now()
639+
now:=dbtime.Time(api.Clock.Now())
640640

641641
templateVersionPresetID:=req.TemplateVersionPresetID
642642

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp