Only apply default timeout when debugger not attached

This commit is contained in:
Dean Herbert 2021-11-18 23:26:45 +09:00
parent 1c13b39104
commit bf8507c7b9
1 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
@ -80,7 +81,10 @@ protected virtual Track GetVirtualTrack(double emptyLength = 0)
public virtual IBeatmap GetPlayableBeatmap(IRulesetInfo ruleset, IReadOnlyList<Mod> mods = null, CancellationToken? cancellationToken = null)
{
var token = cancellationToken ?? new CancellationTokenSource(10000).Token;
var token = cancellationToken ??
// don't apply the default timeout when debugger is attached (may be breakpointing / debugging).
(Debugger.IsAttached ? new CancellationToken() : new CancellationTokenSource(10000).Token);
mods ??= Array.Empty<Mod>();
var rulesetInstance = ruleset.CreateInstance();