mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix(coderd): make activitybump aware of default template ttl (#10253)
The refactored ActivityBump query did not take into account the template-level TTL, resulting in potentially incorrect bump amounts for workspaces that have both a user-defined and template- defined TTL that differ. This change is ported over from PR#10035 to reduce the overall size of that PR. Also includes a drive-by unit test in autobuild for checking template autostop/TTL. Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
@ -28,6 +28,7 @@ type sqlcQuerier interface {
|
||||
// as the TTL wraps. For example, if I set the TTL to 12 hours, sign off
|
||||
// work at midnight, come back at 10am, I would want another full day
|
||||
// of uptime.
|
||||
// We only bump if the raw interval is positive and non-zero.
|
||||
// We only bump if workspace shutdown is manual.
|
||||
// We only bump when 5% of the deadline has elapsed.
|
||||
ActivityBumpWorkspace(ctx context.Context, workspaceID uuid.UUID) error
|
||||
|
Reference in New Issue
Block a user