diff options
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index 31a09216f..f7f73fd4a 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -818,16 +818,17 @@ impl CliOptions { if let Some(lockfile) = self.maybe_lockfile() { if !lockfile.lock().overwrite { - return Ok(Some( - snapshot_from_lockfile(lockfile.clone(), api) - .await - .with_context(|| { - format!( - "failed reading lockfile '{}'", - lockfile.lock().filename.display() - ) - })?, - )); + let snapshot = snapshot_from_lockfile(lockfile.clone(), api) + .await + .with_context(|| { + format!( + "failed reading lockfile '{}'", + lockfile.lock().filename.display() + ) + })?; + // clear the memory cache to reduce memory usage + api.clear_memory_cache(); + return Ok(Some(snapshot)); } } |