mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-12 22:17:22 +01:00
open download filestream with fileshare read
This commit is contained in:
parent
0b458c0f87
commit
9c63ce9c99
1 changed files with 1 additions and 1 deletions
|
|
@ -71,7 +71,7 @@ namespace MareSynchronosServer.Hubs
|
||||||
int readByteCount;
|
int readByteCount;
|
||||||
var buffer = new byte[chunkSize];
|
var buffer = new byte[chunkSize];
|
||||||
|
|
||||||
await using var fs = File.Open(Path.Combine(BasePath, hash), FileMode.Open, FileAccess.Read);
|
await using var fs = File.Open(Path.Combine(BasePath, hash), FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||||
while ((readByteCount = await fs.ReadAsync(buffer, 0, chunkSize, ct)) > 0)
|
while ((readByteCount = await fs.ReadAsync(buffer, 0, chunkSize, ct)) > 0)
|
||||||
{
|
{
|
||||||
await Task.Delay(10, ct);
|
await Task.Delay(10, ct);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue