From cc3c81d42ec8f8de2669fefa35f7a8cfc6b35c4d Mon Sep 17 00:00:00 2001 From: Tommie Gannert Date: Sun, 29 Dec 2024 12:49:31 +0100 Subject: [PATCH] Improve logging. --- syncstorage-mysql/src/models.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/syncstorage-mysql/src/models.rs b/syncstorage-mysql/src/models.rs index 59e5a3699b..4030b0de14 100644 --- a/syncstorage-mysql/src/models.rs +++ b/syncstorage-mysql/src/models.rs @@ -228,9 +228,16 @@ impl MysqlDb { let modified = SyncTimestamp::from_i64(modified)?; let now = SyncTimestamp::from_i64(timestamp)?; // Forbid the write if it would not properly incr the timestamp - warn!("lock check {} {}", modified.as_i64(), now.as_i64()); if modified >= now { - self.rollback_sync().map_err(|err| { warn!("lock rollback {}", &err); err })?; + self.rollback_sync().map_err(|err| { + warn!( + "lock rollback {} {} {}", + modified.as_i64(), + now.as_i64(), + &err + ); + err + })?; return Err(DbError::conflict()); } self.session @@ -242,7 +249,6 @@ impl MysqlDb { let result = sql_query("SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP(2))*1000 AS timestamp") .get_result::(&mut *self.conn.write().unwrap()) .unwrap(); - warn!("lock query {}", result.timestamp); SyncTimestamp::from_i64(result.timestamp)? }; self.set_timestamp(timestamp);