@@ -17,7 +17,7 @@ import (
17
17
18
18
"github.com/coder/coder/v2/cli/clibase"
19
19
"github.com/coder/coder/v2/cli/cliui"
20
- "github.com/coder/coder/v2/coderd/database"
20
+ "github.com/coder/coder/v2/coderd/database/dbtime "
21
21
"github.com/coder/coder/v2/codersdk"
22
22
)
23
23
@@ -82,21 +82,21 @@ func main() {
82
82
Handler : func (inv * clibase.Invocation ) error {
83
83
job := codersdk.ProvisionerJob {
84
84
Status : codersdk .ProvisionerJobPending ,
85
- CreatedAt : database .Now (),
85
+ CreatedAt : dbtime .Now (),
86
86
}
87
87
go func () {
88
88
time .Sleep (time .Second )
89
89
if job .Status != codersdk .ProvisionerJobPending {
90
90
return
91
91
}
92
- started := database .Now ()
92
+ started := dbtime .Now ()
93
93
job .StartedAt = & started
94
94
job .Status = codersdk .ProvisionerJobRunning
95
95
time .Sleep (3 * time .Second )
96
96
if job .Status != codersdk .ProvisionerJobRunning {
97
97
return
98
98
}
99
- completed := database .Now ()
99
+ completed := dbtime .Now ()
100
100
job .CompletedAt = & completed
101
101
job .Status = codersdk .ProvisionerJobSucceeded
102
102
}()
@@ -154,7 +154,7 @@ func main() {
154
154
job .Status = codersdk .ProvisionerJobCanceling
155
155
time .Sleep (time .Second )
156
156
job .Status = codersdk .ProvisionerJobCanceled
157
- completed := database .Now ()
157
+ completed := dbtime .Now ()
158
158
job .CompletedAt = & completed
159
159
return nil
160
160
},
@@ -236,7 +236,7 @@ func main() {
236
236
time .Sleep (144 * time .Millisecond )
237
237
}
238
238
agent .LifecycleState = codersdk .WorkspaceAgentLifecycleReady
239
- readyAt := database .Now ()
239
+ readyAt := dbtime .Now ()
240
240
agent .ReadyAt = & readyAt
241
241
}()
242
242
} else {
@@ -258,7 +258,7 @@ func main() {
258
258
root .Children = append (root .Children , & clibase.Cmd {
259
259
Use : "resources" ,
260
260
Handler : func (inv * clibase.Invocation ) error {
261
- disconnected := database .Now ().Add (- 4 * time .Second )
261
+ disconnected := dbtime .Now ().Add (- 4 * time .Second )
262
262
return cliui .WorkspaceResources (inv .Stdout , []codersdk.WorkspaceResource {{
263
263
Transition : codersdk .WorkspaceTransitionStart ,
264
264
Type : "google_compute_disk" ,
@@ -272,7 +272,7 @@ func main() {
272
272
Type : "google_compute_instance" ,
273
273
Name : "dev" ,
274
274
Agents : []codersdk.WorkspaceAgent {{
275
- CreatedAt : database .Now ().Add (- 10 * time .Second ),
275
+ CreatedAt : dbtime .Now ().Add (- 10 * time .Second ),
276
276
Status : codersdk .WorkspaceAgentConnecting ,
277
277
LifecycleState : codersdk .WorkspaceAgentLifecycleCreated ,
278
278
Name : "dev" ,
0 commit comments