-
Notifications
You must be signed in to change notification settings - Fork 74
Conversation
|
||
namespace Microsoft.DotNet.Watcher.Core.Internal | ||
{ | ||
internal class DotnetFileWatcher : IFileSystemWatcher |
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.
Already in the Internal namespace. Could this be public instead?
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.
No every type in the internal namespace has to be public
{ | ||
public static IFileSystemWatcher CreateWatcher(string watchedDirectory) | ||
{ | ||
var envVar = Environment.GetEnvironmentVariable("USE_POLLING_FILE_WATCHER"); |
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.
Are we using the same var for the cshtml PR that @pranavkm is doing? If so then POLLING_FILE_WATCHER
probably isn't accurate. More like USE_NETWORK_SHARE_FALLBACK
or USE_NETWORK_SHARE_WATCHER
or something. If they are different keys then this is fine :)
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.
I was using ASPNETCORE_POLL_FOR_FILE_CHANGES
. Open to suggestions for alternatives
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.
It has nothing to do with network share. It's just enables a polling file watcher which can be used for non-network shares. Also, it's not an ASPNETCORE feature (at least in dotnet-watch)
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.
I know that, I was throwing out suggestions based on the scenario where it makes sense to use this vs anything else. I am not super worried about them being different, lets talk about it in-person tomorrow.
Tested with an app that has 21K watched files. The changes were instant and you couldn't tell without a profiler the difference in time between the polling watcher and the dotnet one. Also, tested on docker and it works with mounted volumes |
@davidfowl watched the 21K files tests and approved it :) |
Updated the test file watcher to use polling |
8ac7e3f
to
8f1f3c0
Compare
Is this feature available in a NuGet package or Docker image somewhere? |
Yes, it is. Add the
Then, to enable the polling watcher, set the environment variable |
Nice, will try it out! On Fri, Apr 22, 2016 at 5:08 PM, Victor Hurdugaci notifications@github.com
|
Fixes #55
cc @moozzyk