0
loop = asyncio.new_event_loop()
client=TelegramClient(requirements.SESSION_NAME ,requirements.api_id ,requirements.api_hash, loop=loop)

When I use Gunicorn with 1 worker everything is ok. but with more than 1 workers, this error acquires:

c.execute('delete from sessions')
database is locked

thanks for help

Solivan
  • 695
  • 1
  • 8
  • 16
  • 1
    Telethon is an asyncio library. Gunicorn likely uses threads, which means Telethon will not work correctly. See [PyQt, Telethon. How to send a message on button click?](https://stackoverflow.com/q/74521522/) and its comments for more details. – Lonami Nov 22 '22 at 19:54

0 Answers0