Skip to content

Commit df3a9a2

Browse files
committed
Debounce
1 parent ef1792b commit df3a9a2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Files/ViewModels/ItemViewModel.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,14 +1817,14 @@ private async void ProcessOperationQueue(CancellationToken cancellationToken, bo
18171817
const uint FILE_ACTION_RENAMED_OLD_NAME = 0x00000004;
18181818
const uint FILE_ACTION_RENAMED_NEW_NAME = 0x00000005;
18191819

1820-
var sampler = new IntervalSampler(200);
1820+
var sampler = new IntervalSampler(500);
18211821
bool anyEdits = false;
18221822

18231823
try
18241824
{
18251825
while (!cancellationToken.IsCancellationRequested)
18261826
{
1827-
if (operationEvent.Wait(200, cancellationToken))
1827+
if (operationEvent.Wait(500, cancellationToken))
18281828
{
18291829
operationEvent.Reset();
18301830
var updateList = new HashSet<string>();
@@ -1858,7 +1858,7 @@ private async void ProcessOperationQueue(CancellationToken cancellationToken, bo
18581858
App.Logger.Warn(ex, ex.Message);
18591859
}
18601860

1861-
if (anyEdits && sampler.CheckNow())
1861+
if (sampler.CheckNow())
18621862
{
18631863
await OrderFilesAndFoldersAsync();
18641864
await ApplyFilesAndFoldersChangesAsync();
@@ -2229,4 +2229,4 @@ public enum ItemLoadStatus
22292229
/// </summary>
22302230
public string Path { get; set; }
22312231
}
2232-
}
2232+
}

0 commit comments

Comments
 (0)