alexzeitler
alexzeitler
CC#
Created by alexzeitler on 5/22/2024 in #help
ChangeToken / PhysicalFileProvider behavior
I have a PhysicalFileProvider watching for file changes like this
var changeToken = _fileProvider.Watch(filter);
ChangeToken.OnChange(
() => changeToken,
{ var hasChanged = changeToken.HasChanged; }
)
var changeToken = _fileProvider.Watch(filter);
ChangeToken.OnChange(
() => changeToken,
{ var hasChanged = changeToken.HasChanged; }
)
When writing some content - even a short "Hello", to a file which matches the filter, ChangeToken.OnChange is firing multiple times. Is this the expected behavior and do I have to implement some sort of de-duplication if I want a change handler to be called only once?
1 replies