- Possible small fix for .prune ratelimiting

- Use .WhenAll extension instead of Task.WhenAll in a few more places
This commit is contained in:
Kwoth
2022-01-03 04:31:56 +01:00
parent df3e60b61f
commit 21bef1a98e
4 changed files with 6 additions and 7 deletions

View File

@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using NadekoBot.Extensions;
using NadekoBot.Services;
using NUnit.Framework;
@@ -62,8 +63,8 @@ namespace NadekoBot.Tests
_grouper.CreateOrAdd(0, 5);
// add 15 items
await Task.WhenAll(Enumerable.Range(10, 15)
.Select(x => Task.Run(() => _grouper.CreateOrAdd(0, x))));
await Enumerable.Range(10, 15)
.Select(x => Task.Run(() => _grouper.CreateOrAdd(0, x))).WhenAll();
// get 5 at most
_grouper.ClearGroup(0, 5, out var items);