Skip to content

Commit 043c9bb

Browse files
committed
adjusted comments, linked cancellation token for file sync
1 parent c11f6db commit 043c9bb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

App/App.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ private async Task InitializeServicesAsync(CancellationToken cancellationToken =
209209
}
210210

211211
// Initialize file sync.
212-
var syncSessionCts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
212+
using var syncSessionCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
213+
syncSessionCts.CancelAfter(TimeSpan.FromSeconds(10));
213214
var syncSessionController = _services.GetRequiredService<ISyncSessionController>();
214215
try
215216
{

App/Services/SettingsManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ namespace Coder.Desktop.App.Services;
1313
public interface ISettingsManager<T> where T : ISettings<T>, new()
1414
{
1515
/// <summary>
16-
/// Reads the settings from the file system.
17-
/// Always returns the latest settings, even if they were modified by another instance of the app.
18-
/// Returned object is always a fresh instance, so it can be modified without affecting the stored settings.
16+
/// Reads the settings from the file system or returns from cache if available.
17+
/// Returned object is always a cloned instance, so it can be modified without affecting the stored settings.
1918
/// </summary>
2019
/// <param name="ct"></param>
2120
/// <returns></returns>

0 commit comments

Comments
 (0)