X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/016d46008fc9726d2617e4e3ea098113f34c7636..3cdbd017da9ae7a7045f4272f16d4b262fd01c79:/build_run.go?ds=sidebyside diff --git a/build_run.go b/build_run.go index 9c27ff2..cc12cf2 100644 --- a/build_run.go +++ b/build_run.go @@ -19,6 +19,9 @@ import ( // buildLineBytes is the most bytes of one line in a build input or usage log. const buildLineBytes = 1 << 20 +// buildWaitTimeout is the longest wait for pending memory builds. +const buildWaitTimeout = time.Second + // buildQuotaLimit is the largest increase in used quota points of a run. const buildQuotaLimit = 15.0 @@ -113,7 +116,7 @@ func (r *BuildRun) check() string { // waitBuilds waits up to one second without leaving a child context open. func (r *BuildRun) waitBuilds(ctx context.Context) error { - ctx, cancel := context.WithTimeout(ctx, time.Second) + ctx, cancel := context.WithTimeout(ctx, buildWaitTimeout) defer cancel() return r.memory.Wait(ctx)