Skip to content

Commit

Permalink
Merge pull request #348 from danielnorberg/spanner/max-commit-delay
Browse files Browse the repository at this point in the history
spanner: expose max_commit_delay
  • Loading branch information
yoshidan authored Feb 2, 2025
2 parents 8345316 + 97c0a6c commit 6b7938a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spanner/src/transaction_rw.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::ops::Deref;
use std::ops::DerefMut;
use std::sync::atomic::{AtomicI64, Ordering};
use std::time::Duration;

use prost_types::Struct;

Expand All @@ -22,6 +23,7 @@ use crate::value::Timestamp;
pub struct CommitOptions {
pub return_commit_stats: bool,
pub call_options: CallOptions,
pub max_commit_delay: Option<Duration>,
}

/// ReadWriteTransaction provides a locking read-write transaction.
Expand Down Expand Up @@ -331,7 +333,7 @@ pub(crate) async fn commit(
transaction: Some(tx),
request_options: Transaction::create_request_options(commit_options.call_options.priority),
return_commit_stats: commit_options.return_commit_stats,
max_commit_delay: None,
max_commit_delay: commit_options.max_commit_delay.map(|d| d.try_into().unwrap()),
};
let result = session
.spanner_client
Expand Down

0 comments on commit 6b7938a

Please sign in to comment.