Check if this commit was already completed (idempotency).
(
&self,
last_snapshot_for_dup_check: &Option<Snapshot>,
latest_snapshot: &Option<Snapshot>,
commit_kind: &CommitKind,
)
| 503 | |
| 504 | /// Check if this commit was already completed (idempotency). |
| 505 | async fn is_duplicate_commit( |
| 506 | &self, |
| 507 | last_snapshot_for_dup_check: &Option<Snapshot>, |
| 508 | latest_snapshot: &Option<Snapshot>, |
| 509 | commit_kind: &CommitKind, |
| 510 | ) -> bool { |
| 511 | if let (Some(prev_snap), Some(latest)) = (last_snapshot_for_dup_check, latest_snapshot) { |
| 512 | let start_id = prev_snap.id() + 1; |
| 513 | for snapshot_id in start_id..=latest.id() { |
| 514 | if let Ok(snap) = self.snapshot_manager.get_snapshot(snapshot_id).await { |
| 515 | if snap.commit_user() == self.commit_user && snap.commit_kind() == commit_kind { |
| 516 | return true; |
| 517 | } |
| 518 | } |
| 519 | } |
| 520 | } |
| 521 | false |
| 522 | } |
| 523 | |
| 524 | /// Resolve commit entries and merge index entries based on the plan type. |
| 525 | async fn resolve_commit( |
no test coverage detected