Skip to content

Commit

Permalink
Changed update times
Browse files Browse the repository at this point in the history
  • Loading branch information
FeroxFoxxo committed Oct 29, 2023
1 parent cdf762d commit a8efb0e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions backend/Levels/Commands/UpdateAllXp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
Expand All @@ -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)
);
Expand All @@ -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)
);
Expand All @@ -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}%)";
}
}

0 comments on commit a8efb0e

Please sign in to comment.