Skip to content

Commit

Permalink
Use stream mode
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Mar 18, 2024
1 parent 466fb2e commit 9fe16d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Foundatio.Redis/Storage/RedisFileStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public async Task<bool> 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();
}
Expand All @@ -178,7 +178,7 @@ public async Task<bool> 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;

Expand Down

0 comments on commit 9fe16d0

Please sign in to comment.