Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed Mar 22, 2024
1 parent 5eccec8 commit 4fefb97
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/blob_storage/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ mod tests {
let client = test_client();

let list_result = client.list(None).try_collect::<Vec<_>>().await;
if let Err(_) = list_result {
if list_result.is_err() {
println!("localstack not configured skipping test");
return;
}
Expand All @@ -154,7 +154,7 @@ mod tests {
let client = test_client();

let list_result = client.list(None).try_collect::<Vec<_>>().await;
if let Err(_) = list_result {
if list_result.is_err() {
println!("localstack not configured skipping test");
return;
}
Expand Down
25 changes: 14 additions & 11 deletions src/coordinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,21 +409,24 @@ mod tests {
0,
shared_state.unprocessed_state_change_events().await?.len()
);
let tasks = shared_state.tasks_for_executor("test_executor_id", None).await.unwrap();
assert_eq!(
1,
tasks.clone().len()
);
let tasks = shared_state
.tasks_for_executor("test_executor_id", None)
.await
.unwrap();
assert_eq!(1, tasks.clone().len());
assert_eq!(0, shared_state.unassigned_tasks().await?.len());

let mut task_clone = tasks[0].clone();
task_clone.outcome = internal_api::TaskOutcome::Success;
shared_state.update_task(task_clone, Some("test_executor_id".to_string()), vec![]).await.unwrap();
let tasks = shared_state.tasks_for_executor("test_executor_id", None).await.unwrap();
assert_eq!(
0,
tasks.clone().len()
);
shared_state
.update_task(task_clone, Some("test_executor_id".to_string()), vec![])
.await
.unwrap();
let tasks = shared_state
.tasks_for_executor("test_executor_id", None)
.await
.unwrap();
assert_eq!(0, tasks.clone().len());
Ok(())
}

Expand Down
7 changes: 6 additions & 1 deletion src/state/store/state_machine_objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ impl IndexifyState {
) -> Result<(), StateMachineError> {
let task_assignment_cf = StateMachineColumns::TaskAssignments.cf(db);
for (executor_id, task_ids) in task_assignments {
txn.put_cf(task_assignment_cf, executor_id, JsonEncoder::encode(&task_ids)?).map_err(|e| {
txn.put_cf(
task_assignment_cf,
executor_id,
JsonEncoder::encode(&task_ids)?,
)
.map_err(|e| {
StateMachineError::DatabaseError(format!("Error writing task assignments: {}", e))
})?;
}
Expand Down
1 change: 0 additions & 1 deletion src/state/store/state_machine_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ impl StateMachineReader {
})
.unwrap_or_else(Vec::new);


// FIXME Use MULTIGET
let limit = limit.unwrap_or(task_ids.len() as u64) as usize;

Expand Down

0 comments on commit 4fefb97

Please sign in to comment.