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:
@@ -162,6 +162,7 @@ async fn handle_ingest(
|
||||
robot_mode: bool,
|
||||
quiet: bool,
|
||||
metrics: &MetricsLayer,
|
||||
rt_handle: &asupersync::runtime::RuntimeHandle,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let start = std::time::Instant::now();
|
||||
let dry_run = args.dry_run && !args.no_dry_run;
|
||||
@@ -212,7 +213,7 @@ async fn handle_ingest(
|
||||
let recorder = SyncRunRecorder::start(&recorder_conn, &command, run_id_short)?;
|
||||
|
||||
let signal = ShutdownSignal::new();
|
||||
install_ctrl_c_handler(signal.clone());
|
||||
install_ctrl_c_handler(rt_handle, signal.clone());
|
||||
|
||||
let ingest_result: std::result::Result<(), Box<dyn std::error::Error>> = async {
|
||||
match args.entity.as_deref() {
|
||||
@@ -1516,6 +1517,7 @@ async fn handle_embed(
|
||||
config_override: Option<&str>,
|
||||
args: EmbedArgs,
|
||||
robot_mode: bool,
|
||||
rt_handle: &asupersync::runtime::RuntimeHandle,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
@@ -1526,7 +1528,7 @@ async fn handle_embed(
|
||||
let retry_failed = args.retry_failed && !args.no_retry_failed;
|
||||
|
||||
let signal = ShutdownSignal::new();
|
||||
install_ctrl_c_handler(signal.clone());
|
||||
install_ctrl_c_handler(rt_handle, signal.clone());
|
||||
|
||||
let embed_bar = lore::cli::progress::nested_progress("Embedding", 0, robot_mode);
|
||||
let bar_clone = embed_bar.clone();
|
||||
@@ -1565,6 +1567,7 @@ async fn handle_sync_cmd(
|
||||
args: SyncArgs,
|
||||
robot_mode: bool,
|
||||
metrics: &MetricsLayer,
|
||||
rt_handle: &asupersync::runtime::RuntimeHandle,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let dry_run = args.dry_run && !args.no_dry_run;
|
||||
|
||||
@@ -1671,7 +1674,7 @@ async fn handle_sync_cmd(
|
||||
// Skip the normal recorder setup and let the dispatch handle everything.
|
||||
if options.is_surgical() {
|
||||
let signal = ShutdownSignal::new();
|
||||
install_ctrl_c_handler(signal.clone());
|
||||
install_ctrl_c_handler(rt_handle, signal.clone());
|
||||
|
||||
let start = std::time::Instant::now();
|
||||
match run_sync(&config, options, None, &signal).await {
|
||||
@@ -1695,7 +1698,7 @@ async fn handle_sync_cmd(
|
||||
let recorder = SyncRunRecorder::start(&recorder_conn, "sync", run_id_short)?;
|
||||
|
||||
let signal = ShutdownSignal::new();
|
||||
install_ctrl_c_handler(signal.clone());
|
||||
install_ctrl_c_handler(rt_handle, signal.clone());
|
||||
|
||||
let start = std::time::Instant::now();
|
||||
match run_sync(&config, options, Some(run_id_short), &signal).await {
|
||||
|
||||
Reference in New Issue
Block a user