// Copyright Epic Games, Inc. All Rights Reserved.
using StackExchange.Redis;
namespace HordeServer.Utilities;
///
/// Extensions for Redis classes
///
public static class RedisExtensions
{
///
/// Await given tasks and swallow any task cancellation exceptions.
/// Useful to do after (failing) transaction to ensure no trailing tasks are left unawaited
///
///
/// Tasks to await
public static async Task WaitAndIgnoreCancellationsAsync(this ITransaction transaction, params Task[] tasks)
{
_ = transaction;
try
{
await Task.WhenAll(tasks);
}
catch (TaskCanceledException)
{
/* Ignore */
}
}
}