mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-23 17:07:32 +00:00
style: Address review nits on timestamp index
This commit is contained in:
1 parent
251086670f
commit
5687847fe3
3 files changed
+15
-14
No files matched your search
@@ -986,6 +986,14 @@ async fn unembed_unsigned_info(
|
||||
info!(elapsed=?start.elapsed(), total_migrated_pdus=total_migrated, "Finished migration.");
|
||||
}
|
||||
|
||||
async fn drop_server_signingkeys(services: &Services) -> Result<()> {
|
||||
services.db.db.drop_column("server_signingkeys")?;
|
||||
|
||||
info!("Cleared server_signingkeys.");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
const ROOMTS_UNTIL: &str = "populate_roomts_pduid_until";
|
||||
|
||||
async fn populate_roomts_pduid(db: Arc<Database>, until: u64) {
|
||||
@@ -1018,14 +1026,6 @@ async fn populate_roomts_pduid(db: Arc<Database>, until: u64) {
|
||||
info!(elapsed = ?start.elapsed(), "Finished indexing PDUs by timestamp.");
|
||||
}
|
||||
|
||||
async fn drop_server_signingkeys(services: &Services) -> Result<()> {
|
||||
services.db.db.drop_column("server_signingkeys")?;
|
||||
|
||||
info!("Cleared server_signingkeys.");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn fix_oauth_scope_names(services: &Services) -> Result {
|
||||
let db = &services.db;
|
||||
let userdeviceid_oauthsessioninfo = db["userdeviceid_oauthsessioninfo"].clone();
|
||||
|
||||
@@ -330,10 +330,10 @@ impl Data {
|
||||
.try_flatten_stream()
|
||||
}
|
||||
|
||||
pub(super) fn pdus_by_ts<'a>(
|
||||
pub(super) fn pdus_by_timestamp<'a>(
|
||||
&'a self,
|
||||
room_id: &'a RoomId,
|
||||
ts: MilliSecondsSinceUnixEpoch,
|
||||
timestamp: MilliSecondsSinceUnixEpoch,
|
||||
dir: Direction,
|
||||
) -> impl Stream<Item = Result<PdusIterItem>> + Send + 'a {
|
||||
self.services
|
||||
@@ -341,8 +341,9 @@ impl Data {
|
||||
.get_shortroomid(room_id)
|
||||
.map_err(move |e| err!(Request(NotFound("Room {room_id:?} not found: {e:?}"))))
|
||||
.map_ok(move |shortroomid| {
|
||||
let seek =
|
||||
|shorteventid| roomts_key(&PduId { shortroomid, shorteventid }.into(), ts);
|
||||
let seek = |shorteventid| {
|
||||
roomts_key(&PduId { shortroomid, shorteventid }.into(), timestamp)
|
||||
};
|
||||
let keys = match dir {
|
||||
| Direction::Forward => self
|
||||
.roomts_pduid
|
||||
|
||||
@@ -313,10 +313,10 @@ impl Service {
|
||||
pub fn pdus_by_timestamp<'a>(
|
||||
&'a self,
|
||||
room_id: &'a RoomId,
|
||||
ts: MilliSecondsSinceUnixEpoch,
|
||||
timestamp: MilliSecondsSinceUnixEpoch,
|
||||
dir: Direction,
|
||||
) -> impl Stream<Item = Result<PdusIterItem>> + Send + 'a {
|
||||
self.db.pdus_by_ts(room_id, ts, dir)
|
||||
self.db.pdus_by_timestamp(room_id, timestamp, dir)
|
||||
}
|
||||
|
||||
pub async fn timestamp_index_ready(&self) -> bool { self.db.timestamp_index_ready().await }
|
||||
|
||||
Reference in new issue
Block a user