Skip to content

fix: coderd: decouple ttl and deadline #2282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 14, 2022
Prev Previous commit
Next Next commit
fix ttl command
  • Loading branch information
johnstcn committed Jun 14, 2022
commit cd4dce336ce1b8f15319f519c9afec5f43cfb8c3
7 changes: 1 addition & 6 deletions cli/ttl.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,7 @@ func ttlset() *cobra.Command {
return xerrors.Errorf("parse workspace schedule: %w", err)
}

loc, err := time.LoadLocation(sched.Timezone())
if err != nil {
return xerrors.Errorf("schedule has invalid timezone: %w", err)
}

nextShutdown := sched.Next(time.Now()).Add(truncated).In(loc)
nextShutdown := sched.Next(time.Now()).Add(truncated).In(sched.Location())
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%q will shut down at %s on %s (%s after start).\n",
workspace.Name,
nextShutdown.Format("15:04:05 MST"),
Expand Down