mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 01:18:31 +08:00
remove dbg
This commit is contained in:
parent
592fcbc71f
commit
eb7616ca0f
@ -75,10 +75,10 @@ impl<'a> BytesDecode<'a> for UpdateKeyCodec {
|
|||||||
type DItem = (Uuid, u64);
|
type DItem = (Uuid, u64);
|
||||||
|
|
||||||
fn bytes_decode(bytes: &'a [u8]) -> Option<Self::DItem> {
|
fn bytes_decode(bytes: &'a [u8]) -> Option<Self::DItem> {
|
||||||
let uuid_bytes = dbg!(bytes.get(0..size_of::<Uuid>())?.try_into().ok())?;
|
let uuid_bytes = bytes.get(0..size_of::<Uuid>())?.try_into().ok()?;
|
||||||
let uuid = Uuid::from_bytes(uuid_bytes);
|
let uuid = Uuid::from_bytes(uuid_bytes);
|
||||||
|
|
||||||
let update_id_bytes = dbg!(bytes.get(size_of::<Uuid>()..)?.try_into().ok())?;
|
let update_id_bytes = bytes.get(size_of::<Uuid>()..)?.try_into().ok()?;
|
||||||
let update_id = u64::from_be_bytes(update_id_bytes);
|
let update_id = u64::from_be_bytes(update_id_bytes);
|
||||||
|
|
||||||
Some((uuid, update_id))
|
Some((uuid, update_id))
|
||||||
|
@ -237,15 +237,13 @@ impl UpdateStore {
|
|||||||
let mut txn = self.env.write_txn()?;
|
let mut txn = self.env.write_txn()?;
|
||||||
|
|
||||||
let (global_id, update_id) = self.next_update_id(&mut txn, index_uuid)?;
|
let (global_id, update_id) = self.next_update_id(&mut txn, index_uuid)?;
|
||||||
let meta = dbg!(Enqueued::new(meta, update_id, content));
|
let meta = Enqueued::new(meta, update_id, content);
|
||||||
|
|
||||||
self.pending_queue
|
self.pending_queue
|
||||||
.put(&mut txn, &(global_id, index_uuid, update_id), &meta)?;
|
.put(&mut txn, &(global_id, index_uuid, update_id), &meta)?;
|
||||||
|
|
||||||
txn.commit()?;
|
txn.commit()?;
|
||||||
|
|
||||||
dbg!("here");
|
|
||||||
|
|
||||||
self.notification_sender
|
self.notification_sender
|
||||||
.blocking_send(())
|
.blocking_send(())
|
||||||
.expect("Update store loop exited.");
|
.expect("Update store loop exited.");
|
||||||
@ -290,7 +288,7 @@ impl UpdateStore {
|
|||||||
) -> anyhow::Result<Option<()>> {
|
) -> anyhow::Result<Option<()>> {
|
||||||
// Create a read transaction to be able to retrieve the pending update in order.
|
// Create a read transaction to be able to retrieve the pending update in order.
|
||||||
let rtxn = self.env.read_txn()?;
|
let rtxn = self.env.read_txn()?;
|
||||||
let first_meta = dbg!(self.pending_queue.first(&rtxn)?);
|
let first_meta = self.pending_queue.first(&rtxn)?;
|
||||||
drop(rtxn);
|
drop(rtxn);
|
||||||
|
|
||||||
// If there is a pending update we process and only keep
|
// If there is a pending update we process and only keep
|
||||||
@ -326,8 +324,6 @@ impl UpdateStore {
|
|||||||
let content_path = content.map(|uuid| update_uuid_to_file_path(&self.path, uuid));
|
let content_path = content.map(|uuid| update_uuid_to_file_path(&self.path, uuid));
|
||||||
let update_id = processing.id();
|
let update_id = processing.id();
|
||||||
|
|
||||||
dbg!(&processing);
|
|
||||||
|
|
||||||
let file = match content_path {
|
let file = match content_path {
|
||||||
Some(ref path) => {
|
Some(ref path) => {
|
||||||
let file = File::open(path)?;
|
let file = File::open(path)?;
|
||||||
@ -420,7 +416,7 @@ impl UpdateStore {
|
|||||||
|
|
||||||
let txn = self.env.read_txn()?;
|
let txn = self.env.read_txn()?;
|
||||||
// Else, check if it is in the updates database:
|
// Else, check if it is in the updates database:
|
||||||
let update = dbg!(self.updates.get(&txn, &(index_uuid, update_id)))?;
|
let update = self.updates.get(&txn, &(index_uuid, update_id))?;
|
||||||
|
|
||||||
if let Some(update) = update {
|
if let Some(update) = update {
|
||||||
return Ok(Some(update));
|
return Ok(Some(update));
|
||||||
@ -432,7 +428,7 @@ impl UpdateStore {
|
|||||||
for entry in pendings {
|
for entry in pendings {
|
||||||
let ((_, uuid, id), pending) = entry?;
|
let ((_, uuid, id), pending) = entry?;
|
||||||
if uuid == index_uuid && id == update_id {
|
if uuid == index_uuid && id == update_id {
|
||||||
return Ok(Some(dbg!(pending.decode())?.into()));
|
return Ok(Some(pending.decode()?.into()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user