fixed small bug with updating
This commit is contained in:
parent
bff04c7b7e
commit
d8c183df25
12
src/data.rs
12
src/data.rs
@ -263,8 +263,12 @@ impl BrainData {
|
||||
contract.disk_size_gb = updatevmreq.0.disk_size_gb;
|
||||
contract.vcpus = updatevmreq.0.vcpus;
|
||||
contract.memory_mb = updatevmreq.0.memory_mb;
|
||||
contract.kernel_sha = updatevmreq.0.kernel_sha;
|
||||
contract.dtrfs_sha = updatevmreq.0.dtrfs_sha;
|
||||
if !updatevmreq.0.kernel_sha.is_empty() {
|
||||
contract.kernel_sha = updatevmreq.0.kernel_sha;
|
||||
}
|
||||
if !updatevmreq.0.dtrfs_sha.is_empty() {
|
||||
contract.dtrfs_sha = updatevmreq.0.dtrfs_sha;
|
||||
}
|
||||
contract.updated_at = Utc::now().to_rfc3339();
|
||||
}
|
||||
}
|
||||
@ -274,9 +278,7 @@ impl BrainData {
|
||||
mut req: grpc::NewVmReq,
|
||||
tx: OneshotSender<grpc::NewVmResp>,
|
||||
) {
|
||||
if req.uuid.is_empty() {
|
||||
req.uuid = uuid::Uuid::new_v4().to_string();
|
||||
}
|
||||
req.uuid = uuid::Uuid::new_v4().to_string();
|
||||
info!("Inserting new vm request in memory: {req:?}");
|
||||
self.tmp_newvm_reqs
|
||||
.insert(req.uuid.clone(), (req.clone(), tx));
|
||||
|
Loading…
Reference in New Issue
Block a user