Browse Source

深度排序问题修复。

skyffire 1 year ago
parent
commit
d53c67ef86
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/json_db_utils.rs

+ 2 - 2
src/json_db_utils.rs

@@ -139,14 +139,14 @@ pub async fn collect_depth_json(start_timestamp: i64, end_timestamp: i64, exchan
             // 尝试反序列化文件内容
             if let Ok(depth_list) = serde_json::from_str::<Vec<SpecialDepth>>(&content) {
                 // info!("{} 找到 1 条", filename);
-                for depth in depth_list {
+                for depth in depth_list.iter().rev() {
                     // 不在时间范围内的就不要返回了
                     let t = depth.t.to_i64().unwrap();
                     if t < start_timestamp || t > end_timestamp {
                         continue
                     }
 
-                    depths.push(depth)
+                    depths.push(depth.clone())
                 }
             }
         }