mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-20 00:24:20 +01:00
instead of incrementing interaction counter, just substitue the current state
This commit is contained in:
@@ -83,6 +83,7 @@ pub(crate) fn execute_interactions(
|
||||
last_execution.interaction_index = state.interaction_pointer;
|
||||
|
||||
let mut turso_state = state.clone();
|
||||
let mut rusqlite_state = state.clone();
|
||||
|
||||
// first execute turso
|
||||
let turso_res = super::execution::execute_plan(
|
||||
@@ -92,8 +93,6 @@ pub(crate) fn execute_interactions(
|
||||
&mut turso_state,
|
||||
);
|
||||
|
||||
let mut rusqlite_state = state.clone();
|
||||
|
||||
// second execute rusqlite
|
||||
let rusqlite_res = super::execution::execute_plan(
|
||||
&mut rusqlite_env,
|
||||
@@ -112,7 +111,9 @@ pub(crate) fn execute_interactions(
|
||||
return ExecutionResult::new(history, Some(err));
|
||||
}
|
||||
|
||||
state.interaction_pointer += 1;
|
||||
assert_eq!(turso_state, rusqlite_state);
|
||||
|
||||
*state = turso_state;
|
||||
|
||||
// Check if the maximum time for the simulation has been reached
|
||||
if now.elapsed().as_secs() >= env.opts.max_time_simulation as u64 {
|
||||
|
||||
@@ -142,7 +142,9 @@ pub(crate) fn execute_plans(
|
||||
return ExecutionResult::new(history, Some(err));
|
||||
}
|
||||
|
||||
state.interaction_pointer += 1;
|
||||
assert_eq!(turso_state, doublecheck_state);
|
||||
|
||||
*state = turso_state;
|
||||
|
||||
// Check if the maximum time for the simulation has been reached
|
||||
if now.elapsed().as_secs() >= env.opts.max_time_simulation as u64 {
|
||||
|
||||
Reference in New Issue
Block a user