Skip to content

Commit

Permalink
Avoid switching to the background thread when reloading the config.
Browse files Browse the repository at this point in the history
  • Loading branch information
fgimian committed Feb 2, 2025
1 parent a4c8050 commit dde7cf5
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/TotalMixVC/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,6 @@ public bool LoadConfig(bool running = false)
/// <returns>The task object representing the asynchronous operation.</returns>
public async Task ReloadConfigAsync()

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Debug)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.

Check warning on line 177 in src/TotalMixVC/App.xaml.cs

View workflow job for this annotation

GitHub Actions / build (Release)

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
// Switch to the background thread to avoid UI interruptions.
await TaskScheduler.Default;

if (!File.Exists(s_configPath))
{
// It is important to use specify the owner of the message box or it will be closed
Expand All @@ -201,9 +198,6 @@ public async Task ReloadConfigAsync()

_sender.EP = _config.Osc.OutgoingEndPoint;

// Switch to the UI thread and update the tray tooltip text.
await _joinableTaskFactory.SwitchToMainThreadAsync(_taskCancellationTokenSource.Token);

if (_listener?.EP.ToString() != _config.Osc.IncomingEndPoint.ToString())
{
_volumeManager.Listener = null;
Expand Down

0 comments on commit dde7cf5

Please sign in to comment.