Skip to content

Commit a6b5a0b

Browse files
committed
Pass workspace autostart into CalculateAutoStop
1 parent 44bd435 commit a6b5a0b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

coderd/provisionerdserver/provisionerdserver.go

+2
Original file line numberDiff line numberDiff line change
@@ -1257,6 +1257,8 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob)
12571257
UserQuietHoursScheduleStore: *s.UserQuietHoursScheduleStore.Load(),
12581258
Now: now,
12591259
Workspace: workspace,
1260+
// Allowed to be the empty string.
1261+
WorkspaceAutostart: workspace.AutostartSchedule.String,
12601262
})
12611263
if err != nil {
12621264
return xerrors.Errorf("calculate auto stop: %w", err)

enterprise/coderd/schedule/template.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,9 @@ func (s *EnterpriseTemplateScheduleStore) updateWorkspaceBuild(ctx context.Conte
263263
TemplateScheduleStore: s,
264264
UserQuietHoursScheduleStore: *s.UserQuietHoursScheduleStore.Load(),
265265
// Use the job completion time as the time we calculate autostop from.
266-
Now: job.CompletedAt.Time,
267-
Workspace: workspace,
266+
Now: job.CompletedAt.Time,
267+
Workspace: workspace,
268+
WorkspaceAutostart: workspace.AutostartSchedule.String,
268269
})
269270
if err != nil {
270271
return xerrors.Errorf("calculate new autostop for workspace %q: %w", workspace.ID, err)

0 commit comments

Comments
 (0)