forked from StrafesNET/asset-tool
tokio looks like this on some random dude's webpage
This commit is contained in:
parent
9dc67a22c1
commit
e8ef06c2cb
16
src/main.rs
16
src/main.rs
@ -164,7 +164,7 @@ fn maybe_gzip_decode<R:Read>(input:R)->AResult<ReaderType<R>>{
|
||||
|
||||
async fn upload_list(cookie:String,group:Option<u64>,asset_id_file_map:AssetIDFileMap)->AResult<()>{
|
||||
let client=reqwest::Client::new();
|
||||
futures::stream::iter(asset_id_file_map)
|
||||
futures::stream::iter(asset_id_file_map.into_iter()
|
||||
.map(|(asset_id,file)|{
|
||||
let client=&client;
|
||||
let cookie=cookie.as_str();
|
||||
@ -202,7 +202,7 @@ async fn upload_list(cookie:String,group:Option<u64>,asset_id_file_map:AssetIDFi
|
||||
|
||||
Ok((asset_id,resp.bytes().await?))
|
||||
}
|
||||
})
|
||||
}))
|
||||
.buffer_unordered(CONCURRENT_REQUESTS)
|
||||
.for_each(|b:AResult<_>|async{
|
||||
match b{
|
||||
@ -223,7 +223,7 @@ fn read_readable(mut readable:impl Read)->AResult<Vec<u8>>{
|
||||
|
||||
async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult<()>{
|
||||
let client=reqwest::Client::new();
|
||||
futures::stream::iter(asset_id_file_map)
|
||||
futures::stream::iter(asset_id_file_map.into_iter()
|
||||
.map(|(asset_id,file)|{
|
||||
let client=&client;
|
||||
let cookie=cookie.as_str();
|
||||
@ -233,7 +233,7 @@ async fn download_list(cookie:String,asset_id_file_map:AssetIDFileMap)->AResult<
|
||||
.send().await?;
|
||||
Ok((file,resp.bytes().await?))
|
||||
}
|
||||
})
|
||||
}))
|
||||
.buffer_unordered(CONCURRENT_REQUESTS)
|
||||
.for_each(|b:AResult<_>|async{
|
||||
match b{
|
||||
@ -814,7 +814,7 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
|
||||
let repo=git2::Repository::init(config.output_folder.clone())?;
|
||||
|
||||
//decompile all versions
|
||||
futures::stream::iter(asset_list)
|
||||
futures::stream::iter(asset_list.into_iter()
|
||||
.map(|asset_version|{
|
||||
let mut file_path=config.input_folder.clone();
|
||||
tokio::task::spawn(async move{
|
||||
@ -823,7 +823,7 @@ async fn decompile_history_into_git(config:DecompileHistoryConfig)->AResult<()>{
|
||||
let contents=generate_decompiled_context(file)?;
|
||||
Ok::<_,anyhow::Error>((asset_version,contents))
|
||||
})
|
||||
})
|
||||
}))
|
||||
.buffered(CONCURRENT_DECODE)
|
||||
.for_each(|join_handle_result|async{
|
||||
match write_commit(WriteCommitConfig{
|
||||
@ -862,7 +862,7 @@ async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHist
|
||||
|
||||
//download all versions
|
||||
let asset_id_string=config.asset_id.to_string();
|
||||
futures::stream::iter(asset_list)
|
||||
futures::stream::iter(asset_list.into_iter()
|
||||
.map(|asset_version|{
|
||||
let client=client.clone();
|
||||
let cookie=config.cookie.clone();
|
||||
@ -875,7 +875,7 @@ async fn download_and_decompile_history_into_git(config:DownloadAndDecompileHist
|
||||
};
|
||||
Ok::<_,anyhow::Error>((asset_version,contents))
|
||||
})
|
||||
})
|
||||
}))
|
||||
.buffered(CONCURRENT_DECODE)
|
||||
.for_each(|join_handle_result|async{
|
||||
match write_commit(WriteCommitConfig{
|
||||
|
Loading…
Reference in New Issue
Block a user