1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

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

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
@ -80,7 +81,10 @@ namespace osu.Game.Beatmaps
public virtual IBeatmap GetPlayableBeatmap(IRulesetInfo ruleset, IReadOnlyList<Mod> mods = null, CancellationToken? cancellationToken = null) 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>(); mods ??= Array.Empty<Mod>();
var rulesetInstance = ruleset.CreateInstance(); var rulesetInstance = ruleset.CreateInstance();