Skip to content

Commit

Permalink
⚗️ (stop): 继续优化查询
Browse files Browse the repository at this point in the history
  • Loading branch information
czy-29 committed Jan 13, 2025
1 parent c5ac9f6 commit 6fd7913
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tracing-surreal/src/stop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl<C: Connection> Stop<C> {

// last_id: 01JH8CBYAKFSRK8Y9HY02QVTDS
// SELECT * FROM (SELECT *, client_id[*] FROM type::thing($table_name, ..=$last_id) ORDER BY id DESC LIMIT $n) ORDER BY id
let query = "SELECT * FROM (SELECT * FROM type::thing($table_name, ..) ORDER BY id DESC LIMIT $n) ORDER BY id";
let query = "SELECT * FROM type::thing($table_name, ..) ORDER BY id DESC LIMIT $n";
let msgs: Vec<Msg> = self
.db
.query(query)
Expand All @@ -267,7 +267,7 @@ impl<C: Connection> Stop<C> {

// clients + disconnects & merge

Ok(msgs.iter().map(|m| m.message.clone()).collect())
Ok(msgs.iter().rev().map(|m| m.message.clone()).collect())
}

pub async fn print(&self) {
Expand Down

0 comments on commit 6fd7913

Please sign in to comment.