You've already forked AstralRinth
forked from didirus/AstralRinth
Fix forge syncing not working
This commit is contained in:
@@ -82,6 +82,7 @@ pub async fn retrieve_data(
|
||||
visited_artifacts_mutex.lock().await;
|
||||
|
||||
if visited_assets.contains(&lib.name) {
|
||||
lib.name = lib.name.replace(DUMMY_GAME_VERSION, DUMMY_REPLACE_STRING);
|
||||
lib.url = Some(format_url("maven/"));
|
||||
|
||||
return Ok(lib);
|
||||
@@ -92,7 +93,6 @@ pub async fn retrieve_data(
|
||||
|
||||
if lib.name.contains(DUMMY_GAME_VERSION) {
|
||||
lib.name = lib.name.replace(DUMMY_GAME_VERSION, DUMMY_REPLACE_STRING);
|
||||
lib.url = Some(format_url("maven/"));
|
||||
futures::future::try_join_all(list.game.clone().into_iter().map(|game_version| async {
|
||||
let semaphore = semaphore.clone();
|
||||
let uploaded_files_mutex = uploaded_files_mutex.clone();
|
||||
@@ -130,6 +130,7 @@ pub async fn retrieve_data(
|
||||
|
||||
Ok::<(), Error>(())
|
||||
})).await?;
|
||||
lib.url = Some(format_url("maven/"));
|
||||
|
||||
return Ok(lib);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ pub async fn retrieve_data(
|
||||
|
||||
if !loaders.is_empty() {
|
||||
version_futures.push(async {
|
||||
let loaders_versions = Vec::new();
|
||||
let mut loaders_versions = Vec::new();
|
||||
|
||||
{
|
||||
let loaders_futures = loaders.into_iter().map(|(loader_version_full, version)| async {
|
||||
@@ -464,8 +464,9 @@ pub async fn retrieve_data(
|
||||
while versions.peek().is_some() {
|
||||
let now = Instant::now();
|
||||
|
||||
let chunk: Vec<_> = versions.by_ref().take(1).collect();
|
||||
futures::future::try_join_all(chunk).await?;
|
||||
let chunk: Vec<_> = versions.by_ref().take(10).collect();
|
||||
let res = futures::future::try_join_all(chunk).await?;
|
||||
loaders_versions.extend(res.into_iter().flatten());
|
||||
|
||||
chunk_index += 1;
|
||||
|
||||
@@ -493,7 +494,7 @@ pub async fn retrieve_data(
|
||||
while versions.peek().is_some() {
|
||||
let now = Instant::now();
|
||||
|
||||
let chunk: Vec<_> = versions.by_ref().take(10).collect();
|
||||
let chunk: Vec<_> = versions.by_ref().take(1).collect();
|
||||
futures::future::try_join_all(chunk).await?;
|
||||
|
||||
chunk_index += 1;
|
||||
@@ -544,6 +545,8 @@ pub async fn retrieve_data(
|
||||
}
|
||||
}
|
||||
|
||||
println!("{}", serde_json::to_string(&versions).unwrap());
|
||||
|
||||
upload_file_to_bucket(
|
||||
format!(
|
||||
"forge/v{}/manifest.json",
|
||||
|
||||
@@ -44,7 +44,7 @@ async fn main() {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut timer = tokio::time::interval(Duration::from_secs(30 * 60));
|
||||
let mut timer = tokio::time::interval(Duration::from_secs(60 * 60));
|
||||
let semaphore = Arc::new(Semaphore::new(50));
|
||||
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user