mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:23:22 +08:00
Only apply default timeout when debugger not attached
This commit is contained in:
parent
1c13b39104
commit
bf8507c7b9
@ -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 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user