perf: Concurrent resource event fetching, remove unnecessary async
client.rs: - fetch_all_resource_events() now uses tokio::try_join!() to fire all three API requests (state, label, milestone events) concurrently instead of awaiting each sequentially. For entities with many events, this reduces wall-clock time by up to ~3x since the three independent HTTP round-trips overlap. main.rs: - Removed async from handle_issues() and handle_mrs(). These functions perform only synchronous database queries and formatting; they never await anything. Removing the async annotation avoids the overhead of an unnecessary Future state machine and makes the sync nature of these code paths explicit. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,8 +72,8 @@ async fn main() {
|
||||
let quiet = cli.quiet;
|
||||
|
||||
let result = match cli.command {
|
||||
Commands::Issues(args) => handle_issues(cli.config.as_deref(), args, robot_mode).await,
|
||||
Commands::Mrs(args) => handle_mrs(cli.config.as_deref(), args, robot_mode).await,
|
||||
Commands::Issues(args) => handle_issues(cli.config.as_deref(), args, robot_mode),
|
||||
Commands::Mrs(args) => handle_mrs(cli.config.as_deref(), args, robot_mode),
|
||||
Commands::Search(args) => handle_search(cli.config.as_deref(), args, robot_mode).await,
|
||||
Commands::Stats(args) => handle_stats(cli.config.as_deref(), args, robot_mode).await,
|
||||
Commands::Embed(args) => handle_embed(cli.config.as_deref(), args, robot_mode).await,
|
||||
@@ -284,7 +284,7 @@ fn handle_error(e: Box<dyn std::error::Error>, robot_mode: bool) -> ! {
|
||||
// Primary command handlers
|
||||
// ============================================================================
|
||||
|
||||
async fn handle_issues(
|
||||
fn handle_issues(
|
||||
config_override: Option<&str>,
|
||||
args: IssuesArgs,
|
||||
robot_mode: bool,
|
||||
@@ -334,7 +334,7 @@ async fn handle_issues(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn handle_mrs(
|
||||
fn handle_mrs(
|
||||
config_override: Option<&str>,
|
||||
args: MrsArgs,
|
||||
robot_mode: bool,
|
||||
|
||||
Reference in New Issue
Block a user