Skip to content

Commit

Permalink
core: debug upsertion failure (#3348)
Browse files Browse the repository at this point in the history
* core: debug upsertion failure

* orer
  • Loading branch information
spolu authored Jan 22, 2024
1 parent b9a4e44 commit 659de6a
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions core/src/data_sources/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,34 @@ impl DataSource {
)?;

utils::done(&format!(
"Created document blob: data_source_id={} document_id={} duration={}ms",
"Created document blob: data_source_id={} document_id={} duration={}ms blob_url={}",
self.data_source_id,
document_id,
utils::now() - now
utils::now() - now,
format!("gs://{}/{}", bucket, content_path)
));

match document_id {
"notion-95804d6b-0274-43f6-8957-5b024234e3bf" => {
let debug_path = format!("{}/{}/debug.json", bucket_path, document_hash);
Object::create(
&bucket,
serde_json::to_string(&text).unwrap().into_bytes(),
&debug_path,
"application/json",
)
.await?;
utils::done(&format!(
"Uploaded buggy document: data_source_id={} document_id={} debug_blob_url={}",
self.data_source_id,
document_id,
format!("gs://{}/{}", bucket, debug_path)
));
panic!("BUGGY document `{}`", document_id);
}
_ => (),
};

let now = utils::now();

// ChunkInfo is used to store the chunk text and associated hash to avoid recomputing the
Expand Down

0 comments on commit 659de6a

Please sign in to comment.