Skip to content

Commit ba9541d

Browse files
authored
[usage] fix endTime not align to draft stop condition (#18617)
1 parent 16c5278 commit ba9541d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/usage/pkg/apiv1/usage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ func newUsageFromInstance(instance db.WorkspaceInstanceForUsage, pricer *Workspa
414414
startedTime = db.TimeToISO8601(instance.StartedTime.Time())
415415
}
416416
endTime := ""
417-
if instance.StoppingTime.IsSet() {
418-
endTime = db.TimeToISO8601(instance.StoppingTime.Time())
417+
if stopTime.IsSet() {
418+
endTime = db.TimeToISO8601(stopTime.Time())
419419
}
420420
err := usage.SetMetadataWithWorkspaceInstance(db.WorkspaceInstanceUsageData{
421421
WorkspaceId: instance.WorkspaceID,

0 commit comments

Comments
 (0)