[examples] Renamed a file

This commit is contained in:
daladim 2021-04-11 19:15:04 +02:00
parent 62a4063e22
commit 2945bed865

View file

@ -14,6 +14,8 @@ const CACHE_FOLDER: &str = "example_cache";
async fn main() { async fn main() {
env_logger::init(); env_logger::init();
println!("This examples show how to sync a remote server with a local cache, using a Provider");
let cache_path = Path::new(CACHE_FOLDER); let cache_path = Path::new(CACHE_FOLDER);
let client = Client::new(URL, USERNAME, PASSWORD).unwrap(); let client = Client::new(URL, USERNAME, PASSWORD).unwrap();
@ -30,9 +32,10 @@ async fn main() {
println!("---- before sync -----"); println!("---- before sync -----");
my_tasks::utils::print_calendar_list(&cals).await; my_tasks::utils::print_calendar_list(&cals).await;
if let Err(err) = provider.sync().await { if provider.sync().await == false {
log::error!("Unable to sync: {}", err); log::warn!("Sync did not complete, see the previous log lines for more info. You can safely start a new sync.");
} }
println!("---- after sync -----"); println!("---- after sync -----");
let cals = provider.local().get_calendars().await.unwrap(); let cals = provider.local().get_calendars().await.unwrap();
my_tasks::utils::print_calendar_list(&cals).await; my_tasks::utils::print_calendar_list(&cals).await;