Skip to content

Commit

Permalink
removed reference varible to watcher task and prevent diposing matter
Browse files Browse the repository at this point in the history
  • Loading branch information
bezzad committed Dec 19, 2023
1 parent 96a2e21 commit 891a83b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,14 @@ We accept pull requests from the community. But, you should **never** work on a
## You can run tests with Docker Compose file with the following command:
> `docker-compose -p downloader up`
# License
## Or with docker file:
> `docker build -f ./dockerfile -t downloader-linux .`
> `docker run --name downloader-linux-container -d downloader-linux --env=ASPNETCORE_ENVIRONMENT=Development .`
## Or run the following command to call docker directly:
> `docker run --rm -v ${pwd}:/app --env=ASPNETCORE_ENVIRONMENT=Development -w /app/tests mcr.microsoft.com/dotnet/sdk:6.0 dotnet test ../ --logger:trx`
# License
Licensed under the terms of the [MIT License](https://raw.githubusercontent.com/bezzad/Downloader/master/LICENSE)

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fbezzad%2FDownloader.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fbezzad%2FDownloader?ref=badge_large)
Expand Down
3 changes: 1 addition & 2 deletions src/Downloader/ConcurrentStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public class ConcurrentStream : TaskStateManagement, IDisposable
private volatile bool _disposed;
private Stream _stream;
private string _path;
private Task _watcher;
private CancellationTokenSource _watcherCancelSource;

public string Path
Expand Down Expand Up @@ -104,7 +103,7 @@ private void Initial(long maxMemoryBufferBytes, ILogger logger = null)
creationOptions: TaskCreationOptions.LongRunning,
scheduler: TaskScheduler.Default);

_watcher = task.Unwrap();
task.Unwrap();
}

public Stream OpenRead()
Expand Down

0 comments on commit 891a83b

Please sign in to comment.