Compare commits
1 Commits
0e04e67f6e
...
af197dd58f
Author | SHA1 | Date |
---|---|---|
projectmoon | af197dd58f |
|
@ -1,7 +1,7 @@
|
||||||
use crate::db::errors::DataError;
|
use crate::db::errors::DataError;
|
||||||
use crate::db::schema::convert_u64;
|
use crate::db::schema::convert_u64;
|
||||||
use byteorder::BigEndian;
|
use byteorder::BigEndian;
|
||||||
use log::{debug, error, log_enabled};
|
use log::{debug, error, log_enabled, trace};
|
||||||
use sled::transaction::TransactionalTree;
|
use sled::transaction::TransactionalTree;
|
||||||
use sled::Transactional;
|
use sled::Transactional;
|
||||||
use sled::{CompareAndSwapError, Tree};
|
use sled::{CompareAndSwapError, Tree};
|
||||||
|
@ -134,12 +134,12 @@ mod timestamp_index {
|
||||||
) -> Result<(), DataError> {
|
) -> Result<(), DataError> {
|
||||||
let parts: Vec<&[u8]> = key.split(|&b| b == 0xff).collect();
|
let parts: Vec<&[u8]> = key.split(|&b| b == 0xff).collect();
|
||||||
if let [room_id, event_id] = parts[..] {
|
if let [room_id, event_id] = parts[..] {
|
||||||
|
let event_id = str::from_utf8(event_id)?;
|
||||||
let mut ts_key = room_id.to_vec();
|
let mut ts_key = room_id.to_vec();
|
||||||
ts_key.push(0xff);
|
ts_key.push(0xff);
|
||||||
ts_key.extend_from_slice(×tamp_bytes);
|
ts_key.extend_from_slice(×tamp_bytes);
|
||||||
log_index_record(room_id, event_id, ×tamp_bytes);
|
log_index_record(room_id, event_id, ×tamp_bytes);
|
||||||
|
|
||||||
let event_id = str::from_utf8(event_id)?;
|
|
||||||
hashset_tree::add_to_set(roomtimestamp_eventid, &ts_key, event_id.to_owned())?;
|
hashset_tree::add_to_set(roomtimestamp_eventid, &ts_key, event_id.to_owned())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue