Removed persistent aiohttp session and added smaller sessions

This commit is contained in:
2026-01-09 14:58:05 +01:00
parent e86e50ff8a
commit 747d01a652
3 changed files with 8 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
from typing import TYPE_CHECKING
import aiohttp
import requests
from Classifier.classifyHelper import classify_all
@@ -85,7 +86,8 @@ class Commands(commands.Cog):
image_containers : list[x_posts_images] = []
media = await tweetHelper.GetTweetMediaUrls(tweet)
image_containers = [x_posts_images(tweet.id, idx, file = url) for idx, url in enumerate(media)]
downloaded_media = await tweetHelper.DownloadMedia(tweet.id, tweet.author.id, tweet.author.username, media, botData.session)
async with aiohttp.ClientSession() as session:
downloaded_media = await tweetHelper.DownloadMedia(tweet.id, tweet.author.id, tweet.author.username, media, session)
vox_labels = []
final_filtered_tags = {}