You've already forked JapariArchive
Removed persistent aiohttp session and added smaller sessions
This commit is contained in:
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING
|
||||
import asyncio
|
||||
import gc
|
||||
import traceback
|
||||
import aiohttp
|
||||
|
||||
from Classifier.classifyHelper import classify_all
|
||||
from Database.x_classes import DownloadMode
|
||||
@@ -82,7 +83,8 @@ async def download_post(artist: x_accounts, tweet: Tweet, botData: RuntimeBotDat
|
||||
image_containers = [x_posts_images(tweet.id, idx, file = url) for idx, url in enumerate(media)]
|
||||
|
||||
try:
|
||||
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)
|
||||
except DOWNLOAD_FAIL as e:
|
||||
x_post.error_id = e.code
|
||||
|
||||
|
||||
Reference in New Issue
Block a user