gusutabopb / aioinflux

Asynchronous Python client for InfluxDB
MIT License
159 stars 31 forks source link

Used in sanic raise RuntimeError #22

Closed focusontec closed 5 years ago

focusontec commented 5 years ago

when I call await influx_client.writ(somedata) in sainc , it raise "RuntimeError: Timeout context manager should be used inside a task" below are details :

File "C:\Users\zzc\Envs\py37_sanic\lib\site-packages\aioinflux\client.py", line 292, in write
    async with self._session.post(url, params=params, data=data) as resp:
  File "C:\Users\zzc\Envs\py37_sanic\lib\site-packages\aiohttp\client.py", line 1005, in __aenter__
    self._resp = await self._coro
  File "C:\Users\zzc\Envs\py37_sanic\lib\site-packages\aiohttp\client.py", line 417, in _request
    with timer:
  File "C:\Users\zzc\Envs\py37_sanic\lib\site-packages\aiohttp\helpers.py", line 568, in __enter__
    raise RuntimeError('Timeout context manager should be used '
RuntimeError: Timeout context manager should be used inside a task
gusutabopb commented 5 years ago

This is aiohttp, not aioinflux related.

From my experience, usually explicitly specifying the asyncio event loop often fixes this.

You can find more info about this on Stackoverflow or on aio-libs org repos issue trackers.

Closing it for now as not directly related to aioinflux.