From 2945bed865914c2e01e2485728130f8ddc98ca12 Mon Sep 17 00:00:00 2001 From: daladim Date: Sun, 11 Apr 2021 19:15:04 +0200 Subject: [PATCH] [examples] Renamed a file --- examples/{basic.rs => provider-sync.rs} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename examples/{basic.rs => provider-sync.rs} (80%) diff --git a/examples/basic.rs b/examples/provider-sync.rs similarity index 80% rename from examples/basic.rs rename to examples/provider-sync.rs index 1e978b2..14d5365 100644 --- a/examples/basic.rs +++ b/examples/provider-sync.rs @@ -14,6 +14,8 @@ const CACHE_FOLDER: &str = "example_cache"; async fn main() { 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 client = Client::new(URL, USERNAME, PASSWORD).unwrap(); @@ -30,9 +32,10 @@ async fn main() { println!("---- before sync -----"); my_tasks::utils::print_calendar_list(&cals).await; - if let Err(err) = provider.sync().await { - log::error!("Unable to sync: {}", err); + if provider.sync().await == false { + log::warn!("Sync did not complete, see the previous log lines for more info. You can safely start a new sync."); } + println!("---- after sync -----"); let cals = provider.local().get_calendars().await.unwrap(); my_tasks::utils::print_calendar_list(&cals).await;