From fbb3cd49ef5a2a5795a72c718171bc6e03d41232 Mon Sep 17 00:00:00 2001 From: Felix P Date: Thu, 14 Mar 2024 12:53:43 +0100 Subject: [PATCH] Introduce cleanup --- visual-dotnet/SauceLabs.Visual/VisualClient.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/visual-dotnet/SauceLabs.Visual/VisualClient.cs b/visual-dotnet/SauceLabs.Visual/VisualClient.cs index 0624597f..477a544b 100644 --- a/visual-dotnet/SauceLabs.Visual/VisualClient.cs +++ b/visual-dotnet/SauceLabs.Visual/VisualClient.cs @@ -110,12 +110,19 @@ public async Task VisualCheck(string name, VisualCheckOptions? options = return result.Result.Id; } - public void Dispose() + /// + /// Cleanup set a correct status to the build. No action should be made after that calling Cleanup. + /// + public async Task Cleanup() { if (!_externalBuild) { - FinishBuild(Build); + await FinishBuild(Build); } + } + + public void Dispose() + { _api.Dispose(); }