chore: update logs
This commit is contained in:
parent
12a1539f32
commit
b4d79b954b
|
|
@ -183,6 +183,11 @@ impl StorageQueue {
|
||||||
pending_write: PendingWrite,
|
pending_write: PendingWrite,
|
||||||
pending_write_meta: PendingWriteMeta,
|
pending_write_meta: PendingWriteMeta,
|
||||||
) -> Result<(), anyhow::Error> {
|
) -> Result<(), anyhow::Error> {
|
||||||
|
trace!(
|
||||||
|
"queue pending write: {}:{}",
|
||||||
|
pending_write_meta.object_id,
|
||||||
|
pending_write_meta.collab_type
|
||||||
|
);
|
||||||
const MAX_RETRIES: usize = 3;
|
const MAX_RETRIES: usize = 3;
|
||||||
const BASE_DELAY_MS: u64 = 200;
|
const BASE_DELAY_MS: u64 = 200;
|
||||||
const BACKOFF_FACTOR: u64 = 2;
|
const BACKOFF_FACTOR: u64 = 2;
|
||||||
|
|
|
||||||
|
|
@ -97,9 +97,17 @@ where
|
||||||
trace!("collab:{} edit state: {}", self.object_id, self.edit_state);
|
trace!("collab:{} edit state: {}", self.object_id, self.edit_state);
|
||||||
|
|
||||||
// Check if conditions for saving to disk are not met
|
// Check if conditions for saving to disk are not met
|
||||||
|
let is_new = self.edit_state.is_new();
|
||||||
if self.edit_state.should_save_to_disk() {
|
if self.edit_state.should_save_to_disk() {
|
||||||
if let Err(err) = self.save(self.edit_state.is_new()).await {
|
match self.save(is_new).await {
|
||||||
warn!("fail to write: {}:{}", self.object_id, err);
|
Ok(_) => {
|
||||||
|
if is_new {
|
||||||
|
self.edit_state.set_is_new(false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Err(err) => {
|
||||||
|
warn!("fail to write: {}:{}", self.object_id, err);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,10 @@ impl IndexerProvider {
|
||||||
let workspace = collab.workspace_id;
|
let workspace = collab.workspace_id;
|
||||||
let oid = collab.object_id.clone();
|
let oid = collab.object_id.clone();
|
||||||
if let Err(err) = Self::index_collab(&indexer, collab).await {
|
if let Err(err) = Self::index_collab(&indexer, collab).await {
|
||||||
tracing::warn!("failed to index collab {}/{}: {}", workspace, oid, err);
|
// only logging error in debug mode. Will be enabled in production if needed.
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
|
tracing::warn!("failed to index collab {}/{}: {}", workspace, oid, err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue