From 9fe16d0aa29b638cc90ac85cd965412398e3898b Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Mon, 18 Mar 2024 12:35:57 -0500 Subject: [PATCH] Use stream mode --- src/Foundatio.Redis/Storage/RedisFileStorage.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Foundatio.Redis/Storage/RedisFileStorage.cs b/src/Foundatio.Redis/Storage/RedisFileStorage.cs index daa4113..ad59a80 100644 --- a/src/Foundatio.Redis/Storage/RedisFileStorage.cs +++ b/src/Foundatio.Redis/Storage/RedisFileStorage.cs @@ -154,7 +154,7 @@ public async Task RenameFileAsync(string path, string newPath, Cancellatio try { - var stream = await GetFileStreamAsync(normalizedPath, cancellationToken).AnyContext(); + var stream = await GetFileStreamAsync(normalizedPath, StreamMode.Read, cancellationToken).AnyContext(); return await DeleteFileAsync(normalizedPath, cancellationToken).AnyContext() && await SaveFileAsync(normalizedNewPath, stream, cancellationToken).AnyContext(); } @@ -178,7 +178,7 @@ public async Task CopyFileAsync(string path, string targetPath, Cancellati try { - using var stream = await GetFileStreamAsync(normalizedPath, cancellationToken).AnyContext(); + using var stream = await GetFileStreamAsync(normalizedPath, StreamMode.Read, cancellationToken).AnyContext(); if (stream == null) return false;