From 62a34bf89fac94e21bdea9804b8ebd70235104f6 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 23 Jun 2023 19:23:25 +0400 Subject: [PATCH] =?UTF-8?q?Fix=20"file=20=E2=80=9Cconfig.json=E2=80=9D=20c?= =?UTF-8?q?ouldn=E2=80=99t=20be=20opened"=20error=20when=20pruning=20(#525?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix "file “config.json” couldn’t be opened" error when pruning * No need to use the ";" --- Sources/tart/Commands/Prune.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/tart/Commands/Prune.swift b/Sources/tart/Commands/Prune.swift index 138bd9e..091f8f0 100644 --- a/Sources/tart/Commands/Prune.swift +++ b/Sources/tart/Commands/Prune.swift @@ -98,10 +98,11 @@ struct Prune: AsyncParsableCommand { break } - cacheReclaimedBytes += try prunable.sizeBytes() - try prunable.delete() + try SentrySDK.span?.setExtra(value: prunable.sizeBytes(), key: prunable.url.path) - try SentrySDK.span?.setExtra(value: prunable.sizeBytes(), key: prunable.url.path); + cacheReclaimedBytes += try prunable.sizeBytes() + + try prunable.delete() } SentrySDK.span?.setMeasurement(name: "gc_disk_reclaimed", value: cacheReclaimedBytes as NSNumber, unit: MeasurementUnitInformation.byte);