feat(redis): improve key detail auto-refresh and TTL polling

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-31 02:41:26 +08:00
1 parent a662d12f57
commit c697d0c7ad
15 files changed
+540 -106

No files matched your search

+1
View File
@@ -493,6 +493,7 @@ async fn main() {
.route("/redis/scan-keys-batch", post(routes::redis::scan_keys_batch))
.route("/redis/scan-values", post(routes::redis::scan_values))
.route("/redis/get-value", post(routes::redis::get_value))
.route("/redis/get-ttl", post(routes::redis::get_ttl))
.route("/redis/get-stream-entries", post(routes::redis::get_stream_entries))
.route("/redis/get-stream-groups", post(routes::redis::get_stream_groups))
.route("/redis/get-stream-consumers", post(routes::redis::get_stream_consumers))
+10
View File
@@ -331,6 +331,16 @@ pub async fn get_value(
Ok(Json(serde_json::to_value(result).map_err(|e| AppError::from(e.to_string()))?))
}
pub async fn get_ttl(
State(state): State<Arc<WebState>>,
Json(req): Json<RedisKeyRequest>,
) -> Result<Json<i64>, AppError> {
let ttl = dbx_core::redis_ops::redis_get_ttl_in_db_core(&state.app, &req.connection_id, req.db, &req.key_raw)
.await
.map_err(AppError::from)?;
Ok(Json(ttl))
}
pub async fn get_stream_entries(
State(state): State<Arc<WebState>>,
Json(req): Json<RedisStreamEntriesRequest>,