@@ -664,7 +664,7 @@ impl<PdC: PdClient> Transaction<PdC> {
664664 let request = new_heart_beat_request (
665665 self . timestamp . clone ( ) ,
666666 primary_key,
667- self . start_instant . elapsed ( ) . as_millis ( ) as u64 + DEFAULT_LOCK_TTL ,
667+ self . start_instant . elapsed ( ) . as_millis ( ) as u64 + MAX_TTL ,
668668 ) ;
669669 let plan = PlanBuilder :: new ( self . rpc . clone ( ) , request)
670670 . resolve_lock ( self . options . retry_options . lock_backoff . clone ( ) )
@@ -743,7 +743,7 @@ impl<PdC: PdClient> Transaction<PdC> {
743743 keys. clone ( ) . into_iter ( ) ,
744744 primary_lock,
745745 self . timestamp . clone ( ) ,
746- DEFAULT_LOCK_TTL ,
746+ MAX_TTL ,
747747 for_update_ts,
748748 need_value,
749749 ) ;
@@ -822,7 +822,7 @@ impl<PdC: PdClient> Transaction<PdC> {
822822 let request = new_heart_beat_request (
823823 start_ts. clone ( ) ,
824824 primary_key. clone ( ) ,
825- start_instant. elapsed ( ) . as_millis ( ) as u64 + DEFAULT_LOCK_TTL ,
825+ start_instant. elapsed ( ) . as_millis ( ) as u64 + MAX_TTL ,
826826 ) ;
827827 let plan = PlanBuilder :: new ( rpc. clone ( ) , request)
828828 . retry_multi_region ( region_backoff. clone ( ) )
@@ -945,42 +945,49 @@ impl TransactionOptions {
945945 }
946946
947947 /// Try to use async commit.
948+ #[ must_use]
948949 pub fn use_async_commit ( mut self ) -> TransactionOptions {
949950 self . async_commit = true ;
950951 self
951952 }
952953
953954 /// Try to use 1pc.
955+ #[ must_use]
954956 pub fn try_one_pc ( mut self ) -> TransactionOptions {
955957 self . try_one_pc = true ;
956958 self
957959 }
958960
959961 /// Make the transaction read only.
962+ #[ must_use]
960963 pub fn read_only ( mut self ) -> TransactionOptions {
961964 self . read_only = true ;
962965 self
963966 }
964967
965968 /// Don't automatically resolve locks and retry if keys are locked.
969+ #[ must_use]
966970 pub fn no_resolve_locks ( mut self ) -> TransactionOptions {
967971 self . retry_options . lock_backoff = Backoff :: no_backoff ( ) ;
968972 self
969973 }
970974
971975 /// Don't automatically resolve regions with PD if we have outdated region information.
976+ #[ must_use]
972977 pub fn no_resolve_regions ( mut self ) -> TransactionOptions {
973978 self . retry_options . region_backoff = Backoff :: no_backoff ( ) ;
974979 self
975980 }
976981
977982 /// Set RetryOptions.
983+ #[ must_use]
978984 pub fn retry_options ( mut self , options : RetryOptions ) -> TransactionOptions {
979985 self . retry_options = options;
980986 self
981987 }
982988
983989 /// Set the behavior when dropping a transaction without an attempt to commit or rollback it.
990+ #[ must_use]
984991 pub fn drop_check ( mut self , level : CheckLevel ) -> TransactionOptions {
985992 self . check_level = level;
986993 self
@@ -998,6 +1005,7 @@ impl TransactionOptions {
9981005 }
9991006 }
10001007
1008+ #[ must_use]
10011009 pub fn heartbeat_option ( mut self , heartbeat_option : HeartbeatOption ) -> TransactionOptions {
10021010 self . heartbeat_option = heartbeat_option;
10031011 self
0 commit comments