From 47e71930935b125398545e522cd6b35cd5d4ad84 Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Mon, 8 Jul 2024 19:54:39 -0300 Subject: [PATCH] Ensure http client is disposed after execution --- src/File/AddCommand.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/File/AddCommand.cs b/src/File/AddCommand.cs index e6125b9..f5f87e9 100644 --- a/src/File/AddCommand.cs +++ b/src/File/AddCommand.cs @@ -20,7 +20,7 @@ public AddCommand(Config configuration) : base(configuration) { } public override async Task ExecuteAsync() { - var http = HttpClientFactory.Create(); + using var http = HttpClientFactory.Create(); var result = 0; if (Files.Count == 0) @@ -294,6 +294,6 @@ public override async Task ExecuteAsync() /// /// Creates a clone of the current instance. /// - protected virtual AddCommand Clone() => new AddCommand(Configuration); + protected virtual AddCommand Clone() => new AddCommand(Config.Build()); } }