You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Prevents task cancellation exceptions from being thrown. #preflight 63481139e948501224cf6013 [CL 22502870 by carl bystrom in ue5-main branch]
23 lines
721 B
C#
23 lines
721 B
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System.Threading.Tasks;
|
|
using StackExchange.Redis;
|
|
|
|
namespace Horde.Build.Utilities;
|
|
|
|
/// <summary>
|
|
/// Extensions for Redis classes
|
|
/// </summary>
|
|
public static class RedisExtensions
|
|
{
|
|
/// <summary>
|
|
/// Await given tasks and swallow any task cancellation exceptions.
|
|
/// Useful to do after (failing) transaction to ensure no trailing tasks are left unawaited
|
|
/// </summary>
|
|
/// <param name="transaction"></param>
|
|
/// <param name="tasks">Tasks to await</param>
|
|
public static async Task WaitAndIgnoreCancellations(this ITransaction transaction, params Task[] tasks)
|
|
{
|
|
try { await Task.WhenAll(tasks); } catch (TaskCanceledException) { /* Ignore */ }
|
|
}
|
|
} |