Skip to content

Commit

Permalink
最小查询间隔设置为0时,在内部限制为0.5秒
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeric-X committed May 27, 2024
1 parent 43e332c commit 3f3ded2
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,17 @@ private async Task PullLoop(CancellationToken cancelToken)
SyncService.remoteProfilemutex.Release();
}

await Task.Delay(TimeSpan.FromSeconds(_syncConfig.IntervalTime), cancelToken);
await Task.Delay(GetIntervalTime(), cancelToken);
}
}

private TimeSpan GetIntervalTime()
{
var configTime = TimeSpan.FromSeconds(_syncConfig.IntervalTime);
var minTime = TimeSpan.FromSeconds(0.5);
return minTime > configTime ? minTime : configTime;
}

private async Task DownloadProcess(CancellationToken token)
{
var remoteProfile = await _clipboardFactory.CreateProfileFromRemote(token);
Expand Down

0 comments on commit 3f3ded2

Please sign in to comment.