Compare commits

..

5 commits

Author SHA1 Message Date
Izalia Mae 97e9f1a2fd Merge branch 'sqldatabase' into 'master'
Draft: Use SQL database backend

See merge request pleroma/relay!47
2023-01-04 15:24:17 +00:00
Izalia Mae b73e43a9ff Merge branch 'master' into sqldatabase 2022-12-29 07:28:14 -05:00
Izalia Mae f4698aa4dc fix RuntimeError when running commands involving http client 2022-12-29 07:27:35 -05:00
Izalia Mae 76c678b215 fix tinysql optional deps 2022-12-26 05:57:45 -05:00
Izalia Mae 0940921383 handle more client connection errors 2022-12-26 02:02:57 -05:00
2 changed files with 7 additions and 4 deletions

View file

@ -2,7 +2,8 @@ import logging
import traceback
from aiohttp import ClientSession, ClientTimeout, TCPConnector
from aiohttp.client_exceptions import ClientConnectorError, ServerTimeoutError
from aiohttp.client_exceptions import ClientConnectionError, ClientSSLError
from asyncio.exceptions import TimeoutError as AsyncTimeoutError
from aputils import Nodeinfo, WellKnownNodeinfo
from datetime import datetime
from cachetools import LRUCache
@ -143,12 +144,14 @@ class HttpClient(AppBase):
except JSONDecodeError:
logging.verbose(f'Failed to parse JSON')
except (ClientConnectorError, ServerTimeoutError):
except ClientSSLError:
logging.verbose(f'SSL error when connecting to {urlparse(url).netloc}')
except (AsyncTimeoutError, ClientConnectionError):
logging.verbose(f'Failed to connect to {urlparse(url).netloc}')
except Exception as e:
traceback.print_exc()
raise e
async def post(self, inbox, message):

View file

@ -3,4 +3,4 @@ aputils@https://git.barkshark.xyz/barkshark/aputils/archive/0.1.3.tar.gz
cachetools>=5.2.0
click>=8.1.2
pyyaml>=6.0
tinysql[postgres,mysql]@https://git.barkshark.xyz/barkshark/tinysql/archive/0.1.0.tar.gz
tinysql[all]@https://git.barkshark.xyz/barkshark/tinysql/archive/0.1.0.tar.gz