about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2022-08-04 16:54:32 +0900
committerNguyễn Gia Phong <mcsinyx@disroot.org>2022-08-04 16:54:32 +0900
commit9162549a27b02f5f9ce9adea3b957618db460779 (patch)
treec556aa4ec397202fedb4d7dca1a92aaad7e9c6fa /src
parent23a182879c30fa09fa28f4e57ec913559d787e81 (diff)
downloadrsskey-9162549a27b02f5f9ce9adea3b957618db460779.tar.gz
Lower maximum number of connections
Misskey backend is fragile.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/rsskey.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rsskey.py b/src/rsskey.py
index 6e938e0..c8acf53 100755
--- a/src/rsskey.py
+++ b/src/rsskey.py
@@ -21,7 +21,7 @@ from functools import partial
 from re import split, sub
 
 from feedparser import parse
-from httpx import AsyncClient
+from httpx import AsyncClient, Limits
 from loca import Loca
 from markdownify import markdownify as md
 from trio import open_nursery, run
@@ -80,7 +80,8 @@ async def main():
         for section in config:
             if section == 'DEFAULT': continue
             job = config[section]
-            client = AsyncClient(base_url=job['dest'])
+            client = AsyncClient(base_url=job['dest'],
+                                 limits=Limits(max_connections=16))
             await stack.enter_async_context(client)
             nursery.start_soon(mirror, nursery, job, client)