Skip to content

Draft: Fix 'relay inbox follow/unfollow'

Valentin R requested to merge v411e/relay:master into dev

I had the issue that the command for following other instances failed with the following error:

Traceback (most recent call last):
  File "/home/vriess/Dokumente/Repos/relay-1/relay/http_client.py", line 153, in post
    async with self._session.post(url, headers=headers, data=message.to_json()) as resp:
  File "/home/vriess/Dokumente/Repos/relay-1/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/home/vriess/Dokumente/Repos/relay-1/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 448, in _request
    handle = tm.start()
  File "/home/vriess/Dokumente/Repos/relay-1/.venv/lib/python3.10/site-packages/aiohttp/helpers.py", line 651, in start
    return self._loop.call_at(when, self.__call__)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 732, in call_at
    self._check_closed()
  File "/usr/lib/python3.10/asyncio/base_events.py", line 515, in _check_closed
    raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

This fix creates the session directly where it is needed and it seems to work.

Merge request reports

Loading