private void FileRegistrationTrackerOnProjectListChanged(object sender, ProjectsEventArgs e) { Logger.LogInfo("List of projects has changed: Enqueuing a partial file system scan"); // If we are queuing a task that requires rescanning the entire file system, // cancel existing tasks (should be only one really) to avoid wasting time _longRunningFileSystemTaskQueue.CancelCurrentTask(); _longRunningFileSystemTaskQueue.Enqueue(ProjectListChangedTaskId, cancellationToken => { // Pass empty changes, as we don't know of any file system changes for // existing entries. For new entries, they don't exist in the snapshot, // so they will be read form disk var emptyChanges = new FullPathChanges(ArrayUtilities.EmptyList <PathChangeEntry> .Instance); RescanFileSystem(e.Projects, emptyChanges, cancellationToken); }); }
public void CancelCurrentTask() { _taskQueue.CancelCurrentTask(); }