This repository has been archived by the owner. It is now read-only.

Allow file watcher to actively poll for changes #333

Merged
merged 1 commit into from Aug 29, 2018

Conversation

Projects
None yet
3 participants
@pranavkm
Member

pranavkm commented Aug 21, 2018

The ChangeToken.OnChange pattern that's commonly used by providers to listen to
changes requires IChangeToken to be active. The only two instances in the framework
that does not support are the PollingChangeToken.

This change makes the polling be active unless configured otherwise.

Fixes aspnet/Mvc#8173

@pranavkm pranavkm force-pushed the prkrishn/active-polling branch 3 times, most recently from f80e549 to 66a90af Aug 22, 2018

@sebastienros

This comment has been minimized.

Member

sebastienros commented Aug 27, 2018

Should we also fix aspnet/AspNetCore#3110 here ?

/// <seealso cref="UseActivePolling"/>.
/// </summary>
/// <value>
/// Defaults to <see langword="true"/>, if the environment variable <c>DOTNET_USE_POLLING_FILE_WATCHER</c> is <c>true</c> or <c>1</c>.

This comment has been minimized.

@sebastienros

sebastienros Aug 27, 2018

Member

Please change the wording so it's clear that the default is actually false, and it will take whatever value in the ENV otherwise.

}
/// <summary>
/// Disposes the provider. Change tokens may not trigger after the provider is disposed.
/// </summary>
public void Dispose()
{
_filesWatcher.Dispose();
_fileWatcher?.Dispose();

This comment has been minimized.

@sebastienros

sebastienros Aug 27, 2018

Member

We also need a finalize (to fix the other issue)

@natemcmaster natemcmaster removed their request for review Aug 27, 2018

}
Task.Run(() =>
return Task.Run(() =>

This comment has been minimized.

@davidfowl

davidfowl Aug 28, 2018

Member

Avoid the closure 😄

This comment has been minimized.

@pranavkm

pranavkm Aug 28, 2018

Member

I'll undo the change. That said, not super sure how I'd avoid the closure here. Need to pass in a cts to a background Task

@pranavkm pranavkm changed the base branch from release/2.2 to master Aug 28, 2018

@pranavkm pranavkm changed the base branch from master to release/2.2 Aug 28, 2018

@pranavkm

This comment has been minimized.

Member

pranavkm commented Aug 28, 2018

🆙 📅

1 similar comment
@pranavkm

This comment has been minimized.

Member

pranavkm commented Aug 28, 2018

🆙 📅

@pranavkm pranavkm force-pushed the prkrishn/active-polling branch from b24ac14 to 844faa9 Aug 28, 2018

Allow file watcher to actively poll for changes
The ChangeToken.OnChange pattern that's commonly used by providers to listen to
changes requires IChangeToken to be active. The only two instances in the framework
that does not support are the PollingChangeToken.

This change makes the polling be active unless configured otherwise.

Fixes aspnet/Mvc#8173

@pranavkm pranavkm force-pushed the prkrishn/active-polling branch from 6044b42 to 16f9f59 Aug 28, 2018

@pranavkm pranavkm merged commit b9986fc into release/2.2 Aug 29, 2018

4 checks passed

FileSystem-ci 20180828.5 succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details

@pranavkm pranavkm deleted the prkrishn/active-polling branch Aug 29, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.