Fixed file access after downloading the config plugin

This commit is contained in:
Thorsten Sommer 2025-06-02 19:11:17 +02:00
parent ce0b936ed0
commit ea41e84cf3
No known key found for this signature in database
GPG Key ID: B0B7E2FC074BF1F5

View File

@ -43,8 +43,10 @@ public static partial class PluginFactory
var response = await httpClient.GetAsync(downloadUrl, cancellationToken); var response = await httpClient.GetAsync(downloadUrl, cancellationToken);
if (response.IsSuccessStatusCode) if (response.IsSuccessStatusCode)
{ {
await using var tempFileStream = File.Create(tempDownloadFile); await using(var tempFileStream = File.Create(tempDownloadFile))
{
await response.Content.CopyToAsync(tempFileStream, cancellationToken); await response.Content.CopyToAsync(tempFileStream, cancellationToken);
}
var configDirectory = Path.Join(CONFIGURATION_PLUGINS_ROOT, configPlugId.ToString()); var configDirectory = Path.Join(CONFIGURATION_PLUGINS_ROOT, configPlugId.ToString());
if(Directory.Exists(configDirectory)) if(Directory.Exists(configDirectory))