From 20785d9c7bef6fde053beb900c975f98b3eed956 Mon Sep 17 00:00:00 2001 From: Chuck Pierce Date: Tue, 27 Nov 2018 16:34:41 -0800 Subject: [PATCH] Prevent unneeded fetching of Yarn version / index #202 --- crates/notion-core/src/session.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/notion-core/src/session.rs b/crates/notion-core/src/session.rs index 3d2500d54..0c40e2d46 100644 --- a/crates/notion-core/src/session.rs +++ b/crates/notion-core/src/session.rs @@ -174,8 +174,10 @@ impl Session { } if let Some(ref yarn_version) = &image.yarn { - let config = self.config.get()?; - let _ = catalog.fetch_yarn(&VersionSpec::exact(yarn_version), config)?; + if !catalog.yarn.contains(yarn_version) { + let config = self.config.get()?; + let _ = catalog.fetch_yarn(&VersionSpec::exact(yarn_version), config)?; + } } Ok(())