Skip to content

Commit

Permalink
Use thread pool to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
xBaank committed Apr 10, 2024
1 parent 9227aa2 commit fbe2bc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DiscordBot.MusicPlayer/Controllers/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private async Task Play(Func<Result, Task> notifyDelegate)
await notifyDelegate(CurrentSong);
}

_playingTask = StartPlaying();
_playingTask = Task.Run(StartPlaying, Token);

if ((_autoPlayTask is null || _autoPlayTask.IsCompleted) && AutoPlay)
_autoPlayTask = AutoPlayTask();
Expand Down

0 comments on commit fbe2bc5

Please sign in to comment.