allow the cursor to not exist

This commit is contained in:
2025-08-25 18:32:57 -07:00
parent 13cff42bbc
commit bd3605ab87

View File

@@ -1185,15 +1185,24 @@ async fn download_creations_pages_from_checkpoint(context:&CookieContext,owner:r
let (mut asset_list,mut config)=if continue_from_cursor{ let (mut asset_list,mut config)=if continue_from_cursor{
// load state from files // load state from files
let (versions,cursor)=tokio::try_join!( let (versions,cursor)=tokio::join!(
tokio::fs::read(versions_path.as_path()), tokio::fs::read(versions_path.as_path()),
tokio::fs::read_to_string(cursor_path.as_path()), tokio::fs::read_to_string(cursor_path.as_path()),
)?; );
let versions=versions?;
// allow the cursor to not exist
let cursor=match cursor{
Ok(cursor)=>Some(cursor),
Err(e)=>match e.kind(){
std::io::ErrorKind::NotFound=>None,
_=>Err(e)?,
}
};
( (
serde_json::from_slice(&versions)?, serde_json::from_slice(&versions)?,
rbx_asset::cookie::CreationsPageRequest{ rbx_asset::cookie::CreationsPageRequest{
owner, owner,
cursor:Some(cursor), cursor,
} }
) )
}else{ }else{