-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
quick removal of cfm #789
base: main
Are you sure you want to change the base?
quick removal of cfm #789
Conversation
…nto introductions
…nto introductions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See minor comments inline, otherwise looks good (I dont understand the escape hatch for missing file/dir though - see comment).
Perhaps some cleanup in the file DriveFileReaderWriter.cs: everywhere a method returns Task.CompletedTask or Task.FromResult, make it non-async
logger.LogDebug("WriteStream - using OS locking"); | ||
bytesWritten = await WriteStreamInternalAsync(filePath, stream); | ||
} | ||
logger.LogDebug("WriteStream - using OS locking"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove log
logger.LogDebug("GetAllFileBytes - using OS locking"); | ||
bytes = await File.ReadAllBytesAsync(filePath); | ||
} | ||
logger.LogDebug("GetAllFileBytes - using OS locking"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove log
bytes = await File.ReadAllBytesAsync(filePath); | ||
} | ||
logger.LogDebug("GetAllFileBytes - using OS locking"); | ||
bytes = await File.ReadAllBytesAsync(filePath); | ||
}); | ||
} | ||
catch (TryRetryException e) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it not an error if the file or directory is not found?
@@ -145,25 +108,15 @@ await TryRetry.WithDelayAsync( | |||
return bytes; | |||
} | |||
|
|||
public async Task MoveFile(string sourceFilePath, string destinationFilePath) | |||
public Task MoveFile(string sourceFilePath, string destinationFilePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return type here should just be void
} | ||
|
||
/// <summary> | ||
/// Opens a filestream. You must remember to close it. Always opens in Read mode. | ||
/// </summary> | ||
public async Task<Stream> OpenStreamForReading(string filePath) | ||
public Task<Stream> OpenStreamForReading(string filePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void instead of Task
@@ -233,31 +177,23 @@ private async Task<uint> WriteStreamInternalAsync(string filePath, Stream stream | |||
return bytesWritten; | |||
} | |||
|
|||
public async Task DeleteFileAsync(string path) | |||
public Task DeleteFileAsync(string path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void instead of Task
} | ||
catch (TryRetryException e) | ||
{ | ||
throw e.InnerException!; | ||
} | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
public async Task DeleteFilesAsync(string[] paths) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void instead of Task. Remove Async.
No description provided.