Compute local variables before storing them (#2652)
This commit is contained in:
parent
91cc18c411
commit
bee0e950a5
1 changed files with 4 additions and 1 deletions
|
@ -655,7 +655,10 @@ async fn router(
|
||||||
[Value::Strand(Strand(key)), value] => (mem::take(key), mem::take(value)),
|
[Value::Strand(Strand(key)), value] => (mem::take(key), mem::take(value)),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
vars.insert(key, value);
|
match kvs.compute(value, &*session, Some(vars.clone())).await? {
|
||||||
|
Value::None => vars.remove(&key),
|
||||||
|
v => vars.insert(key, v),
|
||||||
|
};
|
||||||
Ok(DbResponse::Other(Value::None))
|
Ok(DbResponse::Other(Value::None))
|
||||||
}
|
}
|
||||||
Method::Unset => {
|
Method::Unset => {
|
||||||
|
|
Loading…
Reference in a new issue