Skip to content
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

Open
wants to merge 217 commits into
base: main
Choose a base branch
from
Open

quick removal of cfm #789

wants to merge 217 commits into from

Conversation

toddmitchell
Copy link
Contributor

No description provided.

Copy link
Collaborator

@sebbarg sebbarg left a 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");
Copy link
Collaborator

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");
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Base automatically changed from intros to main November 4, 2024 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants