3

I'm trying to use Schedule on the background using threads in my Django application as it was described in Oz123's answer, everything works fine without any problem, except when I'm trying to use commands from the terminal (e.g. python manage.py makemigrations or python manage.py runserver ) they will not end and finished until I'm sending keyboardInterupt. Then it will give me the following error:

Traceback (most recent call last):   
  File "/usr/lib/python3.8/threading.py", line 1388, in _shutdown     
    lock.acquire() 

p.s.: for python manage.py runserver I have to send KeyboardInterupt two times. one for ending the server, then the second one will end the function and raise the mentioned error.

My application is using one schedule in the background which is happening every hour to check a model for specific changes. So, there is no stop to this schedule and I want to run it until the server is running (forever).

Is there any way to solve this problem? It is so much annoying to press KeyboardInterupt (CTRL + C) for ending every command.

MAS
  • 31
  • 2

0 Answers0