MCPcopy Index your code
hub / github.com/coder/coder / validWorkspaceAutomaticUpdates

Function validWorkspaceAutomaticUpdates

coderd/workspaces.go:2976–2985  ·  view source on GitHub ↗
(updates codersdk.AutomaticUpdates)

Source from the content-addressed store, hash-verified

2974}
2975
2976func 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
2987func validWorkspaceDeadline(now, startedAt, newDeadline time.Time) error {
2988 soon := now.Add(29 * time.Minute)

Callers 1

createWorkspaceFunction · 0.85

Calls 3

AutomaticUpdatesTypeAlias · 0.92
ValidMethod · 0.65
NewMethod · 0.65

Tested by

no test coverage detected