Skip to content

Commit

Permalink
Retry upload when we get a 429
Browse files Browse the repository at this point in the history
  • Loading branch information
jackTabsCode committed Nov 19, 2024
1 parent f17f53e commit 0850728
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/upload.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{bail, Context};
use log::debug;
use log::{debug, warn};
use rbxcloud::rbx::error::Error;
use rbxcloud::rbx::v1::assets::{
create_asset_with_contents, get_asset, AssetCreation, AssetCreationContext, AssetCreator,
Expand Down Expand Up @@ -125,6 +125,9 @@ pub async fn upload_cloud_asset(
Err(Error::HttpStatusError { code: 404, .. }) => {
debug!("Asset not found, retrying...");
}
Err(Error::HttpStatusError { code: 429, .. }) => {
warn!("Rate limited, retrying...");
}
Err(e) => bail!("Failed to GET asset: {:?}", e),
}

Expand Down

0 comments on commit 0850728

Please sign in to comment.