/// Dispatches downloading of the given file to the appropriate source.
Dispatches downloading of the given file to the appropriate source.
Dispatches downloading of the given file to the appropriate source .
async fn dispatch_download(
        &self,
        source: &RemoteDif,
        destination: PathBuf,
    ) -> Result<DownloadStatus, DownloadError> {
        let result = future_utils::retry(|| async {
            let destination = destination.clone();
            match source {
                RemoteDif::Sentry(inner) => {
                    self.sentry
                        .download_source(inner.clone(), destination)
                        .await
                }
                RemoteDif::Http(inner) => {
                    self.http.download_source(inner.clone(), destination).await
                }
                RemoteDif::S3(inner) => self.s3.download_source(inner.clone(), destination).await,
                RemoteDif::Gcs(inner) => self.gcs.download_source(inner.clone(), destination).await,
                RemoteDif::Filesystem(inner) => {
                    self.fs.download_source(inner.clone(), destination).await
                }
            }
        });
        match result.await {
            Ok(status) => {
                match status {
                    DownloadStatus::Completed => {
                        log::debug!("Fetched debug file from {}", source);
                    }
                    DownloadStatus::NotFound => {
                        log::debug!("Debug file not found at {}", source);
                    }
                };
                Ok(status)
            }
            Err(err) => {
                log::debug!("Failed to fetch debug file from {}: {}", source, err);
                Err(err)
            }
        }
    }
async fn dispatch_download ( & self , source : & RemoteDif , destination : PathBuf , ) -> Result < DownloadStatus , DownloadError > { let result = future_utils :: retry ( | | async { let destination = destination . clone ( ) ; match source { RemoteDif :: Sentry ( inner ) => { self . sentry . download_source ( inner . clone ( ) , destination ) . await } RemoteDif :: Http ( inner ) => { self . http . download_source ( inner . clone ( ) , destination ) . await } RemoteDif :: S3 ( inner ) => self . s3 . download_source ( inner . clone ( ) , destination ) . await , RemoteDif :: Gcs ( inner ) => self . gcs . download_source ( inner . clone ( ) , destination ) . await , RemoteDif :: Filesystem ( inner ) => { self . fs . download_source ( inner . clone ( ) , destination ) . await } } } ) ; match result . await { Ok ( status ) => { match status { DownloadStatus :: Completed => { log :: debug ! ( " " source ) ; } DownloadStatus :: NotFound => { log :: debug ! ( " " source ) ; } } ; Ok ( status ) } Err ( err ) => { log :: debug ! ( " " source err ) ; Err ( err ) } } }
Dispatches downloading of the given file to the appropriate source.
Dispatches downloading of the given file to the appropriate source .
&self
source
&RemoteDif
destination
PathBuf