]> git.giacomolli.uk - onechat/blobdiff - build_run.go
Log image and message sends
[onechat] / build_run.go
index 9c27ff2146b7451a9d7c5c0a5e08864575a69a3e..cc12cf26d2d66542bbab2216a96350079e32d422 100644 (file)
@@ -19,6 +19,9 @@ import (
 // buildLineBytes is the most bytes of one line in a build input or usage log.
 const buildLineBytes = 1 << 20
 
 // 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
 
 // 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 {
 
 // 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)
        defer cancel()
 
        return r.memory.Wait(ctx)