feat(runtime): replace tokio+reqwest with asupersync async runtime

- Add HTTP adapter layer (src/http.rs) wrapping asupersync h1 client
- Migrate gitlab client, graphql, and ollama to HTTP adapter
- Swap entrypoint from #[tokio::main] to RuntimeBuilder::new().block_on()
- Rewrite signal handler for asupersync (RuntimeHandle::spawn + ctrl_c())
- Migrate rate limiter sleeps to asupersync::time::sleep(wall_now(), d)
- Add asupersync-native HTTP integration tests
- Convert timeline_seed_tests to RuntimeBuilder pattern

Phases 1-3 of asupersync migration (atomic: code won't compile without all pieces).
This commit is contained in:
teernisse
2026-03-06 15:23:55 -05:00
parent bf977eca1a
commit e8d6c5b15f
16 changed files with 1974 additions and 1189 deletions

View File

@@ -52,8 +52,18 @@ use lore::core::trace::run_trace;
use lore::ingestion::storage::queue::release_all_locked_jobs;
use lore::ingestion::storage::sync_run::SyncRunRecorder;
#[tokio::main]
async fn main() {
fn main() {
let rt = match asupersync::runtime::RuntimeBuilder::new().build() {
Ok(rt) => rt,
Err(e) => {
eprintln!("Failed to build async runtime: {e}");
std::process::exit(1);
}
};
let rt_handle = rt.handle();
rt.block_on(async {
#[cfg(unix)]
unsafe {
libc::signal(libc::SIGPIPE, libc::SIG_DFL);
@@ -245,9 +255,9 @@ async fn main() {
.await
}
Some(Commands::Stats(args)) => handle_stats(cli.config.as_deref(), args, robot_mode).await,
Some(Commands::Embed(args)) => handle_embed(cli.config.as_deref(), args, robot_mode).await,
Some(Commands::Embed(args)) => handle_embed(cli.config.as_deref(), args, robot_mode, &rt_handle).await,
Some(Commands::Sync(args)) => {
handle_sync_cmd(cli.config.as_deref(), args, robot_mode, &metrics_layer).await
handle_sync_cmd(cli.config.as_deref(), args, robot_mode, &metrics_layer, &rt_handle).await
}
Some(Commands::Ingest(args)) => {
handle_ingest(
@@ -256,6 +266,7 @@ async fn main() {
robot_mode,
quiet,
&metrics_layer,
&rt_handle,
)
.await
}
@@ -414,6 +425,7 @@ async fn main() {
if let Err(e) = result {
handle_error(e, robot_mode);
}
}); // rt.block_on
}
include!("app/dispatch.rs");