mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2026-05-05 04:06:16 +02:00
docs: Remove commented code, unneeded TODO, unneeded collision tracking (#1563)
This commit is contained in:
parent
771813087c
commit
5cdfd03498
@ -85,7 +85,6 @@ pub trait ReportableError: std::fmt::Display {
|
||||
}
|
||||
|
||||
/// Experimental: return key value pairs for Sentry Event's extra data
|
||||
/// TODO: should probably return Vec<(&str, Value)> or Vec<(String, Value)>
|
||||
fn extras(&self) -> Vec<(&str, Value)> {
|
||||
vec![]
|
||||
}
|
||||
|
||||
@ -94,7 +94,6 @@ macro_rules! build_app {
|
||||
))
|
||||
.wrap_fn(middleware::weave::set_weave_timestamp)
|
||||
.wrap_fn(tokenserver::logging::handle_request_log_line)
|
||||
//.wrap_fn(middleware::sentry::report_error)
|
||||
.wrap_fn(middleware::rejectua::reject_user_agent)
|
||||
.wrap($cors)
|
||||
.wrap_fn(middleware::emit_http_status_with_tokenserver_origin)
|
||||
@ -203,7 +202,6 @@ macro_rules! build_app_without_syncstorage {
|
||||
"api_error".to_owned(),
|
||||
))
|
||||
// These are our wrappers
|
||||
//.wrap_fn(middleware::sentry::report_error)
|
||||
.wrap_fn(tokenserver::logging::handle_request_log_line)
|
||||
.wrap_fn(middleware::rejectua::reject_user_agent)
|
||||
// Followed by the "official middleware" so they run first.
|
||||
|
||||
@ -53,12 +53,9 @@ fn static_collection_id() -> DbResult<()> {
|
||||
// The integration tests can create collections that start
|
||||
// with `xxx%`. We should not include those in our counts for local
|
||||
// unit tests.
|
||||
// Note: not sure why but as of 11/02/20, `.not_like("xxx%")` is apparently
|
||||
// swedish-ci. Commenting that out for now.
|
||||
let results: HashMap<i32, String> = collections::table
|
||||
.select((collections::id, collections::name))
|
||||
.filter(collections::name.ne(""))
|
||||
//.filter(collections::name.not_like("xxx%")) // from most integration tests
|
||||
.filter(collections::name.ne("xxx_col2")) // from server::test
|
||||
.filter(collections::name.ne("col2")) // from older intergration tests
|
||||
.load(&db.inner.conn)?
|
||||
|
||||
@ -283,8 +283,6 @@ pub async fn do_append_async(
|
||||
|
||||
//prefetch the existing batch_bsos for this user's batch.
|
||||
let mut existing = HashSet::new();
|
||||
let mut collisions = HashSet::new();
|
||||
let mut count_collisions = 0;
|
||||
let mut tags = HashMap::new();
|
||||
tags.insert(
|
||||
"collection".to_owned(),
|
||||
@ -351,13 +349,6 @@ pub async fn do_append_async(
|
||||
payload: bso.payload,
|
||||
ttl: bso.ttl,
|
||||
});
|
||||
// BSOs should only update records that were in previous batches.
|
||||
// There is the potential that some may update records in their own batch.
|
||||
// This will attempt to record such incidents.
|
||||
// TODO: If we consistently see no results for this, it can be safely dropped.
|
||||
if collisions.contains(&exist_idx) {
|
||||
count_collisions += 1;
|
||||
}
|
||||
} else {
|
||||
let sortindex = bso
|
||||
.sortindex
|
||||
@ -389,18 +380,9 @@ pub async fn do_append_async(
|
||||
value.set_list_value(row);
|
||||
insert.push(value);
|
||||
existing.insert(exist_idx.clone());
|
||||
collisions.insert(exist_idx);
|
||||
};
|
||||
}
|
||||
|
||||
if count_collisions > 0 {
|
||||
db.metrics.count_with_tags(
|
||||
"storage.spanner.batch.collisions",
|
||||
count_collisions,
|
||||
tags.clone(),
|
||||
);
|
||||
}
|
||||
|
||||
if db.quota.enabled {
|
||||
if let Some(size) = batch.size {
|
||||
if size + running_size >= db.quota.size {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user