(&self, sandbox: &DriverSandbox)
| 1049 | } |
| 1050 | |
| 1051 | async fn reserve_pending_sandbox(&self, sandbox: &DriverSandbox) -> Result<(), Status> { |
| 1052 | let mut pending = self.pending.lock().await; |
| 1053 | if pending |
| 1054 | .values() |
| 1055 | .any(|record| record.sandbox.id == sandbox.id || record.sandbox.name == sandbox.name) |
| 1056 | { |
| 1057 | return Err(Status::already_exists("sandbox already exists")); |
| 1058 | } |
| 1059 | |
| 1060 | pending.insert( |
| 1061 | sandbox.id.clone(), |
| 1062 | PendingSandboxRecord { |
| 1063 | sandbox: pending_sandbox_snapshot( |
| 1064 | sandbox, |
| 1065 | &self.config.sandbox_namespace, |
| 1066 | provisioning_condition(), |
| 1067 | false, |
| 1068 | ), |
| 1069 | task: None, |
| 1070 | }, |
| 1071 | ); |
| 1072 | Ok(()) |
| 1073 | } |
| 1074 | |
| 1075 | async fn pending_snapshot( |
| 1076 | &self, |
no test coverage detected