diff options
author | 2024-06-11 15:36:43 +0100 | |
---|---|---|
committer | 2024-06-11 16:01:15 +0100 | |
commit | 20de0129e53cde506027ede0dc3d3fadb5382148 (patch) | |
tree | 120234b601d2849c67b149e91262a38601657bf1 | |
parent | Bump ruff from 0.4.6 to 0.4.8 (#3085) (diff) |
Use new itertool.batched instead of more_itertools.chunked
-rw-r--r-- | bot/exts/backend/sync/_syncers.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/backend/sync/_syncers.py b/bot/exts/backend/sync/_syncers.py index e1ed6dff4..88f34e9a8 100644 --- a/bot/exts/backend/sync/_syncers.py +++ b/bot/exts/backend/sync/_syncers.py @@ -1,11 +1,11 @@ import abc import typing as t from collections import namedtuple +from itertools import batched import discord.errors from discord import Guild from discord.ext.commands import Context -from more_itertools import chunked from pydis_core.site_api import ResponseCodeError import bot @@ -225,10 +225,10 @@ class UserSyncer(Syncer): # Using asyncio.gather would still consume too many resources on the site. log.trace("Syncing created users...") if diff.created: - for chunk in chunked(diff.created, CHUNK_SIZE): + for chunk in batched(diff.created, CHUNK_SIZE): await bot.instance.api_client.post("bot/users", json=chunk) log.trace("Syncing updated users...") if diff.updated: - for chunk in chunked(diff.updated, CHUNK_SIZE): + for chunk in batched(diff.updated, CHUNK_SIZE): await bot.instance.api_client.patch("bot/users/bulk_patch", json=chunk) |