From cedaf73785c17cc55b8edbb209ccb0f54d28e902 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Thu, 20 Jul 2017 20:03:11 +0200 Subject: [PATCH] Sped up .streamrole initialization 5x, but it might error out if there are too many users streaming when the command is ran. --- src/NadekoBot/Modules/Utility/Services/StreamRoleService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/NadekoBot/Modules/Utility/Services/StreamRoleService.cs b/src/NadekoBot/Modules/Utility/Services/StreamRoleService.cs index 48fc53f0..65560db9 100644 --- a/src/NadekoBot/Modules/Utility/Services/StreamRoleService.cs +++ b/src/NadekoBot/Modules/Utility/Services/StreamRoleService.cs @@ -253,8 +253,7 @@ namespace NadekoBot.Modules.Utility.Services foreach (var usr in await fromRole.Guild.GetUsersAsync(CacheMode.CacheOnly).ConfigureAwait(false)) { - await TryApplyRole(usr, setting).ConfigureAwait(false); - await Task.Delay(500).ConfigureAwait(false); + await Task.WhenAll(TryApplyRole(usr, setting), Task.Delay(100)).ConfigureAwait(false); } }