mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-22 22:18:24 +00:00
Try using ConcurrentDictionary for caching in tests
This commit is contained in:
@@ -1,12 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Concurrent;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Cli.Tests.Utils
|
namespace DiscordChatExporter.Cli.Tests.Utils
|
||||||
{
|
{
|
||||||
internal static class GlobalCache
|
internal static class GlobalCache
|
||||||
{
|
{
|
||||||
private static readonly Dictionary<string, object?> Dictionary = new();
|
private static readonly ConcurrentDictionary<string, object?> Dictionary = new();
|
||||||
|
|
||||||
public static async Task<T> WrapAsync<T>(string key, Func<Task<T>> getAsync)
|
public static async Task<T> WrapAsync<T>(string key, Func<Task<T>> getAsync)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user