diff --git a/server/src/data_sources/builder.rs b/server/src/data_sources/builder.rs index 862fc42c..e42bacff 100644 --- a/server/src/data_sources/builder.rs +++ b/server/src/data_sources/builder.rs @@ -33,13 +33,13 @@ pub struct SinkInfo { pub metrics_interval_seconds: u64, } -fn build_offline(offline_args: OfflineArgs) -> EdgeResult { +fn build_offline(offline_args: OfflineArgs) -> EdgeResult>> { let provider = OfflineProvider::instantiate_provider( offline_args.bootstrap_file, offline_args.client_keys, )?; let provider = Arc::new(RwLock::new(provider)); - Ok((provider.clone(), provider)) + Ok(provider) } fn build_memory(sender: Sender) -> EdgeResult { @@ -55,7 +55,7 @@ fn build_redis(redis_url: String, sender: Sender) -> EdgeResult EdgeResult { match args.mode { EdgeMode::Offline(offline_args) => { - let (source, _) = build_offline(offline_args)?; + let source = build_offline(offline_args)?; Ok(RepositoryInfo { source, sink_info: None, diff --git a/server/src/data_sources/offline_provider.rs b/server/src/data_sources/offline_provider.rs index c6cb9175..f58072ea 100644 --- a/server/src/data_sources/offline_provider.rs +++ b/server/src/data_sources/offline_provider.rs @@ -1,9 +1,7 @@ use crate::error::EdgeError; use crate::types::{ - ClientFeaturesResponse, EdgeResult, EdgeSink, EdgeSource, EdgeToken, FeatureSink, - FeaturesSource, TokenSink, TokenSource, TokenValidationStatus, + EdgeResult, EdgeSource, EdgeToken, FeaturesSource, TokenSource, TokenValidationStatus, }; -use actix_web::http::header::EntityTag; use async_trait::async_trait; use std::collections::HashMap; use std::fs::File; @@ -62,30 +60,6 @@ impl TokenSource for OfflineProvider { } impl EdgeSource for OfflineProvider {} -impl EdgeSink for OfflineProvider {} - -#[async_trait] -impl FeatureSink for OfflineProvider { - async fn sink_features( - &mut self, - _token: &EdgeToken, - _features: ClientFeatures, - ) -> EdgeResult<()> { - todo!() - } - async fn fetch_features(&mut self, _token: &EdgeToken) -> EdgeResult { - Ok(ClientFeaturesResponse::NoUpdate(EntityTag::new_weak( - "this_provider_does_not_support_refreshing_features".into(), - ))) - } -} - -#[async_trait] -impl TokenSink for OfflineProvider { - async fn sink_tokens(&mut self, _token: Vec) -> EdgeResult<()> { - todo!() - } -} impl OfflineProvider { pub fn instantiate_provider(