summaryrefslogtreecommitdiffstats
path: root/src/db/builds/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/builds/mod.rs')
-rw-r--r--src/db/builds/mod.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/db/builds/mod.rs b/src/db/builds/mod.rs
index 2035cfd..fc84335 100644
--- a/src/db/builds/mod.rs
+++ b/src/db/builds/mod.rs
@@ -127,6 +127,14 @@ pub fn queued(db: &Db, limit: i64) -> Result<Vec<String>> {
})
}
+/// Lease one named build to a worker.
+///
+/// Test-tier only. Production leases a *batch* — `claim_batch` is what the
+/// dispatcher runs — and nothing in the crate calls this single-build form.
+/// It stays because three test files lease one build at a time on purpose,
+/// and a test that wants to reason about one lease should not have to
+/// arrange for the batch form to hand back exactly one.
+#[cfg(feature = "test-support")]
pub fn claim(db: &Db, owner: &str, id: &str, lease_secs: i64) -> Result<bool> {
let (owner, id) = (owner.to_string(), id.to_string());
let exp = time::secs_ahead(lease_secs);
@@ -291,5 +299,5 @@ pub use steps::{
begin_step, blocked_builds, cancel_superseded, claim_batch,
finish_step, in_flight, queue_depth, requeue_transient,
retry, set_blocked_on, set_release_in, set_world,
- step_status, steps, touch,
+ step_status, steps,
};