Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9aab8b

Browse files
committed
fixup! Merge remote-tracking branch 'origin/main' into 1433-template-constraint-for-workspace-scheduling
1 parent 60ef479 commit c9aab8b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cli/create.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ func create() *cobra.Command {
271271
}
272272

273273
func validSchedule(minute, hour, dow, tzName string, min time.Duration) (*string, error) {
274+
_, err := time.LoadLocation(tzName)
275+
if err != nil {
276+
return nil, xerrors.Errorf("Invalid workspace autostart timezone: %w", err)
277+
}
278+
274279
schedSpec := fmt.Sprintf("CRON_TZ=%s %s %s * * %s", tzName, minute, hour, dow)
275280

276281
sched, err := schedule.Weekly(schedSpec)

0 commit comments

Comments
 (0)