allow the cursor to not exist
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -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{
|
||||
// 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_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)?,
|
||||
rbx_asset::cookie::CreationsPageRequest{
|
||||
owner,
|
||||
cursor:Some(cursor),
|
||||
cursor,
|
||||
}
|
||||
)
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user