(updates codersdk.AutomaticUpdates)
| 2974 | } |
| 2975 | |
| 2976 | func validWorkspaceAutomaticUpdates(updates codersdk.AutomaticUpdates) (database.AutomaticUpdates, error) { |
| 2977 | if updates == "" { |
| 2978 | return database.AutomaticUpdatesNever, nil |
| 2979 | } |
| 2980 | dbAU := database.AutomaticUpdates(updates) |
| 2981 | if !dbAU.Valid() { |
| 2982 | return "", xerrors.New("Automatic updates must be always or never") |
| 2983 | } |
| 2984 | return dbAU, nil |
| 2985 | } |
| 2986 | |
| 2987 | func validWorkspaceDeadline(now, startedAt, newDeadline time.Time) error { |
| 2988 | soon := now.Add(29 * time.Minute) |
no test coverage detected