fix: Remove rate limiting for emoji and sticker processing to enhance parallel execution speed
This commit is contained in:
parent
d7341b3ec2
commit
a210776635
@ -288,7 +288,7 @@ class GurtCog(commands.Cog, name="Gurt"): # Added explicit Cog name
|
|||||||
mime_type = "image/gif" if emoji.animated else "image/png"
|
mime_type = "image/gif" if emoji.animated else "image/png"
|
||||||
description = await api.generate_image_description(self, emoji_url, emoji.name, "emoji", mime_type)
|
description = await api.generate_image_description(self, emoji_url, emoji.name, "emoji", mime_type)
|
||||||
await self.emoji_manager.add_emoji(name_key, str(emoji.id), emoji.animated, guild_id, emoji_url, description or "No description generated.")
|
await self.emoji_manager.add_emoji(name_key, str(emoji.id), emoji.animated, guild_id, emoji_url, description or "No description generated.")
|
||||||
await asyncio.sleep(1) # Rate limiting
|
# await asyncio.sleep(1) # Rate limiting removed for faster parallel processing
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error processing single emoji {emoji.name} (ID: {emoji.id}) in guild {emoji.guild.name}: {e}")
|
print(f"Error processing single emoji {emoji.name} (ID: {emoji.id}) in guild {emoji.guild.name}: {e}")
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ class GurtCog(commands.Cog, name="Gurt"): # Added explicit Cog name
|
|||||||
description_to_add = f"Unsupported format: {sticker.format}, visual description not applicable."
|
description_to_add = f"Unsupported format: {sticker.format}, visual description not applicable."
|
||||||
|
|
||||||
await self.emoji_manager.add_sticker(name_key, str(sticker.id), guild_id, sticker_url, description_to_add)
|
await self.emoji_manager.add_sticker(name_key, str(sticker.id), guild_id, sticker_url, description_to_add)
|
||||||
await asyncio.sleep(1) # Rate limiting
|
# await asyncio.sleep(1) # Rate limiting removed for faster parallel processing
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error processing single sticker {sticker.name} (ID: {sticker.id}) in guild ID {sticker.guild_id}: {e}")
|
print(f"Error processing single sticker {sticker.name} (ID: {sticker.id}) in guild ID {sticker.guild_id}: {e}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user