MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / release

Method release

crates/openshell-server/src/compute/lease.rs:201–215  ·  view source on GitHub ↗

Release the lease so a standby replica can acquire immediately without waiting for TTL expiry.

(&self, guard: LeaseGuard)

Source from the content-addressed store, hash-verified

199 /// Release the lease so a standby replica can acquire immediately
200 /// without waiting for TTL expiry.
201 pub async fn release(&self, guard: LeaseGuard) -> Result<(), LeaseError> {
202 match self
203 .store
204 .delete_if(
205 LEASE_OBJECT_TYPE,
206 LEASE_SINGLETON_ID,
207 guard.resource_version,
208 )
209 .await
210 {
211 Ok(_) => Ok(()),
212 Err(PersistenceError::Conflict { .. }) => Err(LeaseError::Conflict),
213 Err(e) => Err(LeaseError::Store(e)),
214 }
215 }
216
217 /// Read the current lease record, if any.
218 pub async fn read(&self) -> Result<Option<LeaseRecord>, LeaseError> {

Calls 2

StoreEnum · 0.85
delete_ifMethod · 0.45

Tested by

no test coverage detected