From a8efb0e38ecc97a7e086b625b25068ebca042073 Mon Sep 17 00:00:00 2001 From: FeroxFoxxo Date: Sun, 29 Oct 2023 23:52:06 +1300 Subject: [PATCH] Changed update times --- backend/Levels/Commands/UpdateAllXp.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/Levels/Commands/UpdateAllXp.cs b/backend/Levels/Commands/UpdateAllXp.cs index 0521248a4..2b063bb7e 100644 --- a/backend/Levels/Commands/UpdateAllXp.cs +++ b/backend/Levels/Commands/UpdateAllXp.cs @@ -64,7 +64,7 @@ public async Task UpdateAllXpCommand() count++; - if (count % 50 == 0) + if (count % 100 == 0) await infoMsg.ModifyAsync(x => x.Content = "Calculating... " + GetProgressString(count, totalCount) ); @@ -77,7 +77,9 @@ await infoMsg.ModifyAsync(x => { await addedUser.Key.AddRolesAsync(addedUser.Value); - if (count % 50 == 0) + count++; + + if (count % 5 == 0) await infoMsg.ModifyAsync(x => x.Content = "Adding Roles... " + GetProgressString(count, totalCount) ); @@ -90,7 +92,9 @@ await infoMsg.ModifyAsync(x => { await removedUser.Key.RemoveRolesAsync(removedUser.Value); - if (count % 50 == 0) + count++; + + if (count % 5 == 0) await infoMsg.ModifyAsync(x => x.Content = "Removing Roles... " + GetProgressString(count, totalCount) ); @@ -104,6 +108,6 @@ await infoMsg.ModifyAsync(x => public static string GetProgressString(int count, int total) { var progress = Math.Floor((double)count / total * 100); - return $"Progress {count}/{total} ({progress}%)"; + return $"progress {count}/{total} ({progress}%)"; } }