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

Function validWorkspaceDeadline

coderd/workspaces.go:2987–2999  ·  view source on GitHub ↗
(now, startedAt, newDeadline time.Time)

Source from the content-addressed store, hash-verified

2985}
2986
2987func validWorkspaceDeadline(now, startedAt, newDeadline time.Time) error {
2988 soon := now.Add(29 * time.Minute)
2989 if newDeadline.Before(soon) {
2990 return errDeadlineTooSoon
2991 }
2992
2993 // No idea how this could happen.
2994 if newDeadline.Before(startedAt) {
2995 return errDeadlineBeforeStart
2996 }
2997
2998 return nil
2999}
3000
3001func validWorkspaceSchedule(s *string) (sql.NullString, error) {
3002 if ptr.NilOrEmpty(s) {

Callers 1

putExtendWorkspaceMethod · 0.85

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected