mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2026-05-06 04:36:28 +02:00
Merge branch 'master' into docs/examples-for-local-dev
This commit is contained in:
commit
2ba6642f44
@ -1,2 +1,2 @@
|
||||
# Temp limit on the number of incoming records (See issue #298/#333)
|
||||
limits.max_total_records=1999
|
||||
limits.max_total_records=1666
|
||||
|
||||
@ -81,6 +81,8 @@ pub(super) struct SpannerDbSession {
|
||||
pub(super) mutations: Option<Vec<Mutation>>,
|
||||
in_write_transaction: bool,
|
||||
execute_sql_count: u64,
|
||||
/// Whether touch_collection has already been called
|
||||
touched_collection: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@ -816,6 +818,11 @@ impl SpannerDb {
|
||||
// buffered on the client side and only issued to Spanner in the final
|
||||
// transaction Commit.
|
||||
let timestamp = self.timestamp()?;
|
||||
if self.session.borrow().touched_collection {
|
||||
// No need to touch it again
|
||||
return Ok(timestamp);
|
||||
}
|
||||
|
||||
let sqlparams = params! {
|
||||
"fxa_uid" => user_id.fxa_uid.clone(),
|
||||
"fxa_kid" => user_id.fxa_kid.clone(),
|
||||
@ -858,6 +865,7 @@ impl SpannerDb {
|
||||
.param_types(sql_types)
|
||||
.execute(&self.conn)?;
|
||||
}
|
||||
self.session.borrow_mut().touched_collection = true;
|
||||
Ok(timestamp)
|
||||
}
|
||||
|
||||
|
||||
@ -259,10 +259,6 @@ pub fn post_collection_batch(
|
||||
// Spanner we would pay twice the mutations for those pending
|
||||
// items (once writing them to to batch_bsos, then again
|
||||
// writing them to bsos)
|
||||
|
||||
// NOTE: Unfortunately this means we make two calls to
|
||||
// touch_collection (in post_bsos and then commit_batch). The
|
||||
// second touch is redundant, writing the same timestamp
|
||||
Either::A(
|
||||
coll.db
|
||||
.post_bsos(params::PostBsos {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user