fix: broadcast event use file id (#6891)

- [x] fix: broadcast event use file id
- [x] feat: add metrics for consistent hashing
This commit is contained in:
Hengfei Yang
2025-05-23 16:56:06 +08:00
committed by GitHub
parent 9c585d73a4
commit b058106166
26 changed files with 517 additions and 454 deletions
+16
View File
@@ -231,6 +231,14 @@ pub async fn cli() -> Result<bool, anyhow::Error> {
.required(true)
.help("snowflake id"),
]),
clap::Command::new("consistent-hash").about("consistent hash").args([
clap::Arg::new("file")
.short('f')
.long("file")
.required(true)
.num_args(1..)
.help("file"),
]),
clap::Command::new("upgrade-db")
.about("upgrade db table schemas").args(dataArgs()),
])
@@ -495,6 +503,14 @@ pub async fn cli() -> Result<bool, anyhow::Error> {
let td = t.format("%Y-%m-%dT%H:%M:%SZ").to_string();
println!("datetimes: {}", td);
}
"consistent-hash" => {
let files = command
.get_many::<String>("file")
.unwrap()
.collect::<Vec<_>>();
let files = files.iter().map(|f| f.to_string()).collect::<Vec<_>>();
super::http::consistent_hash(files).await?;
}
"upgrade-db" => {
crate::migration::init_db().await?;
}