pub struct SyncConfig {
pub concurrency: usize,
pub embedding_batch_size: usize,
pub upsert_batch_size: usize,
pub force_full_sync: bool,
pub dry_run: bool,
pub circuit_breaker: CircuitBreakerConfig,
}Expand description
Portal synchronization configuration (combined harvest + embed).
This is a convenience type that composes HarvestConfig and
EmbeddingServiceConfig for the common harvest-then-embed workflow.
Used by crate::HarvestPipeline and kept for backward compatibility.
TODO(config): Support CLI arg --concurrency and env var SYNC_CONCURRENCY
Optimal value depends on portal rate limits and system resources.
Consider auto-tuning based on API response times.
Fields§
§concurrency: usizeNumber of concurrent dataset processing tasks.
embedding_batch_size: usizeMaximum number of texts per embedding API batch call.
The actual batch size is min(this, provider.max_batch_size()).
upsert_batch_size: usizeMaximum number of datasets per DB upsert batch.
force_full_sync: boolForce full sync even if incremental sync is available.
dry_run: boolPreview mode: fetch and compare datasets without writing to DB or calling embedding API.
circuit_breaker: CircuitBreakerConfigCircuit breaker configuration for API resilience.
Implementations§
Source§impl SyncConfig
impl SyncConfig
Sourcepub fn with_full_sync(self) -> Self
pub fn with_full_sync(self) -> Self
Creates a new SyncConfig with force_full_sync enabled.
Sourcepub fn with_dry_run(self) -> Self
pub fn with_dry_run(self) -> Self
Creates a new SyncConfig with dry_run enabled.
Sourcepub fn with_embedding_batch_size(self, size: usize) -> Self
pub fn with_embedding_batch_size(self, size: usize) -> Self
Creates a new SyncConfig with a custom embedding batch size.
Sourcepub fn with_circuit_breaker(self, config: CircuitBreakerConfig) -> Self
pub fn with_circuit_breaker(self, config: CircuitBreakerConfig) -> Self
Creates a new SyncConfig with custom circuit breaker configuration.
Sourcepub fn harvest_config(&self) -> HarvestConfig
pub fn harvest_config(&self) -> HarvestConfig
Extracts the harvest-only configuration.
Sourcepub fn embedding_service_config(&self) -> EmbeddingServiceConfig
pub fn embedding_service_config(&self) -> EmbeddingServiceConfig
Extracts the embedding service configuration.
Trait Implementations§
Source§impl Clone for SyncConfig
impl Clone for SyncConfig
Source§fn clone(&self) -> SyncConfig
fn clone(&self) -> SyncConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more