5

I am using Django Channels for a real-time progress bar. With the help of this progressbar the client gets actual feedback of a simulation. This simulation can take longer than 5 minutes depending on the data size. Now to the problem. The client can start the simulation successfully, but during this time no other page can be loaded. Furthermore I get the following error message:

Application instance <Task pending coro=<StaticFilesWrapper.__call__() running at /.../python3.7/site-packages/channels/staticfiles.py:44> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/futures.py:348, <TaskWakeupMethWrapper object at 0x123aa88e8>()]>> for connection <WebRequest at 0x123ab7e10 method=GET uri=/2/ clientproto=HTTP/1.1> took too long to shut down and was killed.

Only after the simulation is finished, further pages can be loaded.

There are already articles on this topic, but they do not contain any working solutions for me. Like for example in the following link: https://github.com/django/channels/issues/1119 A suggestion here is to downgrade the Channels version. However, I encounter other errors and it must also work with the newer versions.

The code of the consumer, routing and asgi are implemented exactly as required in the instructions: https://channels.readthedocs.io/en/stable/tutorial/index.html

requirments.txt:

Django==3.1.2
channels==3.0.3
channels-redis==3.3.1
asgiref==3.2.10
daphne==3.0.2

I am grateful for any hint or tip.

Best regards, Dennis

Dennis
  • 51
  • 3

0 Answers0