Make PhysicalFilesWatcher exclusively use polling when pollForChanges=true and no...
authorEric StJohn <ericstj@microsoft.com>
Thu, 12 Nov 2020 15:16:18 +0000 (07:16 -0800)
committerGitHub <noreply@github.com>
Thu, 12 Nov 2020 15:16:18 +0000 (07:16 -0800)
commit457ed114aebe9798fd58bbf9733194e51b734896
tree025e9e55f7ce05ac3a0d428d42150cee029ae8c1
parent731dee4a8d9ad231826106ad59d3a5841738e774
Make PhysicalFilesWatcher exclusively use polling when pollForChanges=true and no FSW is provided (#41426)

When a FileSystemWatcher is not passed to the PhysicalFileWatcher
we'll permit construction (if polling is enabled) and have it behave as
exclusively polling.

The PhysicalFileProvider will use this mode when both
UsePollingFileWatcher and UseActivePolling are set which is what happens
when the DOTNET_USE_POLLING_FILE_WATCHER environment variable is set.
src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFileProvider.cs
src/libraries/Microsoft.Extensions.FileProviders.Physical/src/PhysicalFilesWatcher.cs
src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Resources/Strings.resx [new file with mode: 0644]
src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs