mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: add locked TTL field to template meta (#8020)
This commit is contained in:
@ -327,6 +327,7 @@ func (*enterpriseTemplateScheduleStore) GetTemplateScheduleOptions(ctx context.C
|
||||
MaxTTL: time.Duration(tpl.MaxTTL),
|
||||
FailureTTL: time.Duration(tpl.FailureTTL),
|
||||
InactivityTTL: time.Duration(tpl.InactivityTTL),
|
||||
LockedTTL: time.Duration(tpl.LockedTTL),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -335,6 +336,7 @@ func (*enterpriseTemplateScheduleStore) SetTemplateScheduleOptions(ctx context.C
|
||||
int64(opts.MaxTTL) == tpl.MaxTTL &&
|
||||
int64(opts.FailureTTL) == tpl.FailureTTL &&
|
||||
int64(opts.InactivityTTL) == tpl.InactivityTTL &&
|
||||
int64(opts.LockedTTL) == tpl.LockedTTL &&
|
||||
opts.UserAutostartEnabled == tpl.AllowUserAutostart &&
|
||||
opts.UserAutostopEnabled == tpl.AllowUserAutostop {
|
||||
// Avoid updating the UpdatedAt timestamp if nothing will be changed.
|
||||
@ -350,6 +352,7 @@ func (*enterpriseTemplateScheduleStore) SetTemplateScheduleOptions(ctx context.C
|
||||
MaxTTL: int64(opts.MaxTTL),
|
||||
FailureTTL: int64(opts.FailureTTL),
|
||||
InactivityTTL: int64(opts.InactivityTTL),
|
||||
LockedTTL: int64(opts.LockedTTL),
|
||||
})
|
||||
if err != nil {
|
||||
return database.Template{}, xerrors.Errorf("update template schedule: %w", err)
|
||||
|
Reference in New Issue
Block a user