refactor: workspace autostop_schedule -> ttl (#1578)

Co-authored-by: G r e y <grey@coder.com>
This commit is contained in:
Cian Johnston
2022-05-19 20:09:27 +01:00
committed by GitHub
parent 6c1117094d
commit d72c45e483
31 changed files with 549 additions and 490 deletions

View File

@ -172,7 +172,7 @@ func TestDiff(t *testing.T) {
TemplateID: uuid.UUID{3},
Name: "rust workspace",
AutostartSchedule: sql.NullString{String: "0 12 * * 1-5", Valid: true},
AutostopSchedule: sql.NullString{String: "0 2 * * 2-6", Valid: true},
Ttl: sql.NullInt64{Int64: int64(8 * time.Hour), Valid: true},
},
exp: audit.Map{
"id": uuid.UUID{1}.String(),
@ -180,7 +180,7 @@ func TestDiff(t *testing.T) {
"template_id": uuid.UUID{3}.String(),
"name": "rust workspace",
"autostart_schedule": "0 12 * * 1-5",
"autostop_schedule": "0 2 * * 2-6",
"ttl": int64(28800000000000), // XXX: pq still does not support time.Duration
},
},
{
@ -194,7 +194,7 @@ func TestDiff(t *testing.T) {
TemplateID: uuid.UUID{3},
Name: "rust workspace",
AutostartSchedule: sql.NullString{},
AutostopSchedule: sql.NullString{},
Ttl: sql.NullInt64{},
},
exp: audit.Map{
"id": uuid.UUID{1}.String(),