From 8babcee8fdfa5b0f460aa1e6d8057feb7d2fda49 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 7 Jan 2026 11:57:55 +0000 Subject: Add sync_identifier orchestration and ThrottleManager queue processing Implement the main sync orchestration function and trigger-based queue processing for throttled domains: sync_identifier function: - Orchestrates syncing git data for a single identifier - Tries all non-throttled URLs in sequence - Checks completion after each fetch (no pending events or all OIDs fetched) - Enqueues with throttled domains when non-throttled URLs are exhausted - Returns true if complete, false if events remain (for backoff) ThrottleManager enhancements: - Add set_context() to provide SyncContext for queue processing - Add try_process_next() to spawn tasks when capacity frees - Add process_queued_identifier() to handle queued work - Update complete_request() to trigger processing on completion - Update enqueue_identifier() to trigger processing when capacity available - Add internal methods for non-Arc testing compatibility Generic function updates: - Add ?Sized bound to sync_identifier_next_url, sync_identifier_from_url, sync_identifier, and get_throttled_domains_with_untried_urls for dynamic dispatch support (Arc) Tests: - sync_identifier_tries_multiple_urls_until_complete: verifies sequential URL fetching until all OIDs are available - sync_identifier_enqueues_throttled_domains_when_incomplete: verifies throttled domains get the identifier enqueued for later processing - has_queued_work_reflects_queue_state: verifies queue state tracking --- src/purgatory/sync/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/purgatory/sync/mod.rs') diff --git a/src/purgatory/sync/mod.rs b/src/purgatory/sync/mod.rs index d26c1f0..8ac9216 100644 --- a/src/purgatory/sync/mod.rs +++ b/src/purgatory/sync/mod.rs @@ -13,8 +13,8 @@ mod throttle; pub use context::{ProcessResult, SyncContext}; pub use functions::{ - get_throttled_domains_with_untried_urls, sync_identifier_from_url, sync_identifier_next_url, - ThrottledDomainInfo, + get_throttled_domains_with_untried_urls, sync_identifier, sync_identifier_from_url, + sync_identifier_next_url, ThrottledDomainInfo, }; pub use queue::SyncQueueEntry; pub use throttle::{DomainThrottle, ThrottleManager}; -- cgit v1.2.3