Git Product home page Git Product logo

aiolinebot's Issues

NameError: name 'Group' is not defined

I think auto generate api.py has some issues.

  File "/sss/backend/app/models/_common.py", line 41, in get_starting_name
    group_summary = await api.get_group_summary_async(self)
  File "/sss/backend/.venv/lib/python3.8/site-packages/aiolinebot/api.py", line 302, in get_group_summary_async
    return Group.new_from_json_dict(response.json)
NameError: name 'Group' is not defined

poetry fail to install directly via git

poetry add git+https://github.com/CircleOnCircles/aiolinebot.git#put-missing

  PackageInfoError

  Unable to determine package info for path: C:\Users\n2\AppData\Local\Temp\pypoetry-git-aiolinebo_u6ztofg

  Fallback egg_info generation failed.

  Command C:\Users\n2\AppData\Local\Temp\tmpwkp710lo\.venv\Scripts\python.exe setup.py egg_info errored with the following return code 1, and output:
  Traceback (most recent call last):
    File "setup.py", line 2, in <module>
      from aiolinebot import __version__
    File "C:\Users\n2\AppData\Local\Temp\pypoetry-git-aiolinebo_u6ztofg\aiolinebot\__init__.py", line 1, in <module>
      from linebot import __version__ as linebot_version
  ModuleNotFoundError: No module named 'linebot'

  at ~\.poetry\lib\poetry\inspection\info.py:502 in _pep517_metadata
      498│                 try:
      499│                     venv.run("python", "setup.py", "egg_info")
      500│                     return cls.from_metadata(path)
      501│                 except EnvCommandError as fbe:
    → 502│                     raise PackageInfoError(
      503│                         path, "Fallback egg_info generation failed.", fbe
      504│                     )
      505│                 finally:
      506│                     os.chdir(cwd.as_posix())

after use it in production for awhile I faced `asyncio.TimeoutError` often

This is an error log from await api.reply_message_async(

TimeoutError: null
  File "starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "starlette/routing.py", line 566, in __call__
    await route.handle(scope, receive, send)
  File "starlette/routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "starlette/routing.py", line 41, in app
    response = await func(request)
  File "fastapi/routing.py", line 182, in app
    raw_response = await run_endpoint_function(
  File "fastapi/routing.py", line 133, in run_endpoint_function
    return await dependant.call(**values)
  File "api/v1/webhooks/line.py", line 26, in handle_line_webhook
    await handler.handle_async(body, signature)
  File "linebot/webhook.py", line 325, in handle_async
    await self.__invoke_func_async(func, event, payload)
  File "linebot/webhook.py", line 352, in __invoke_func_async
    await function_return
  File "chatbot/handlers.py", line 43, in handle_message
    await response_to_magic_word(event)
  File "chatbot/conversations/all.py", line 104, in response_to_magic_word
    await api.reply_message_async(
  File "aiolinebot/api.py", line 1064, in reply_message_async
    await self._post_async(
  File "aiolinebot/api.py", line 1244, in _post_async
    response = await self.aiohttp_client.post(
  File "aiolinebot/http_client.py", line 154, in post
    async with client_session.post(
  File "aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "aiohttp/client.py", line 619, in _request
    break
  File "aiohttp/helpers.py", line 656, in __exit__
    raise asyncio.TimeoutError from None

Global AioHTTPSession

Q. Is there a possibility of having a Global Session or a pool of AioHTTPSessions which remain connected to LINE endpoints ?

Because from what I have obeserved, almost upto 40-60% of the time consumed in sending a web request comes from creating a session and one of core concepts of aiohttp and other similar libraries like httpx resolves around the fact that sessions could be reused.

In my app I was able to achieve a reduction of upto 50% response time when using a global session which refreshes after a certain period of time, ofc it is cumbersome to use without being it integrated into the library, but anyways it was just a test case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.