Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bce12de

Browse files
Document zero behaviour
1 parent ed9c472 commit bce12de

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

coderd/database/querier_test.go

+7
Original file line numberDiff line numberDiff line change
@@ -4472,6 +4472,13 @@ func TestGetPresetsAtFailureLimit(t *testing.T) {
44724472
hardLimit: 3,
44734473
expHitHardLimit: false,
44744474
},
4475+
// hardLimit set to zero, implicitly disables the hard limit.
4476+
{
4477+
name: "despite 5 failed builds, the hard limit is not reached because it's disabled.",
4478+
buildSuccesses: []bool{false, false, false, false, false},
4479+
hardLimit: 0,
4480+
expHitHardLimit: false,
4481+
},
44754482
}
44764483

44774484
for _, tc := range testCases {

codersdk/deployment.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,7 @@ type PrebuildsConfig struct {
811811
// FailureHardLimit defines the maximum number of consecutive failed prebuild attempts allowed
812812
// before a preset is considered to be in a hard limit state. When a preset hits this limit,
813813
// no new prebuilds will be created until the limit is reset.
814+
// FailureHardLimit is disabled when set to zero.
814815
FailureHardLimit serpent.Int64 `json:"failure_hard_limit" typescript:"failure_hard_limit"`
815816
}
816817

@@ -3093,7 +3094,7 @@ Write out the current server config as YAML to stdout.`,
30933094
},
30943095
{
30953096
Name: "Failure Hard Limit",
3096-
Description: "Maximum number of consecutive failed prebuilds before a preset hits the hard limit.",
3097+
Description: "Maximum number of consecutive failed prebuilds before a preset hits the hard limit. FailureHardLimit is disabled when set to zero.",
30973098
Flag: "workspace-prebuilds-failure-hard-limit",
30983099
Env: "CODER_WORKSPACE_PREBUILDS_FAILURE_HARD_LIMIT",
30993100
Value: &c.Prebuilds.FailureHardLimit,

0 commit comments

Comments
 (0)