Last active
March 25, 2020 10:02
-
-
Save trimoq/f27e0d24962cc2c6c5810e0ba193cf66 to your computer and use it in GitHub Desktop.
The slightly simplified process function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub async fn process(request: DownloadTask, cfg: ConverterConfig) -> Result<...>{ | |
let bytes = download_url(request.url).await?; | |
let (image, thumbnail) = tokio::task::spawn_blocking(|| process_image(bytes)).await?; | |
push_to_s3(image, cfg, request.target_path).await?; | |
push_to_s3(thumbnail, cfg, request.thumbnail_path).await?; | |
info!("Finished download for {}",request.correlation_id); | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment