我正在使用PyCharm运行一个Django项目,其中使用了django-q。在一个实例中运行manage.py runserver
,在另一个实例中运行manage.py qcluster
。 qcluster
能够成功启动,但马上就会优雅地退出。以下是完整的文本:
/Users/user/PycharmProjects/project/venv/bin/python /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 65362 --file /Users/user/PycharmProjects/project/manage.py qcluster --settings=project.settings.dev
Connected to pydev debugger (build 193.6494.30)
pydev debugger: process 21339 is connecting
16:03:44 [Q] INFO Q Cluster grey-kentucky-georgia-avocado starting.
16:03:44 [Q] INFO Process-1 guarding cluster grey-kentucky-georgia-avocado
16:03:44 [Q] INFO Q Cluster grey-kentucky-georgia-avocado running.
16:03:44 [Q] INFO Process-1:1 ready for work at 21343
16:03:44 [Q] INFO Process-1:2 ready for work at 21344
16:03:44 [Q] INFO Process-1:3 ready for work at 21345
16:03:44 [Q] INFO Process-1:4 ready for work at 21346
16:03:44 [Q] INFO Process-1:5 ready for work at 21347
16:03:44 [Q] INFO Process-1:6 monitoring at 21348
16:03:44 [Q] INFO Process-1:7 pushing tasks at 21349
16:03:44 [Q] INFO Q Cluster grey-kentucky-georgia-avocado stopping.
16:03:44 [Q] INFO Process-1 stopping cluster processes
16:03:45 [Q] INFO Process-1:7 stopped pushing tasks
16:03:46 [Q] INFO Process-1:1 stopped doing work
16:03:46 [Q] INFO Process-1:2 stopped doing work
16:03:46 [Q] INFO Process-1:3 stopped doing work
16:03:46 [Q] INFO Process-1:4 stopped doing work
16:03:46 [Q] INFO Process-1:5 stopped doing work
16:03:47 [Q] INFO Process-1 waiting for the monitor.
16:03:47 [Q] INFO Process-1:6 stopped monitoring results
16:03:47 [Q] INFO Q Cluster grey-kentucky-georgia-avocado has stopped.
Process finished with exit code 0
显然,我希望它能永久运行。如果我从PyCharm的
manage.py
终端运行它,则可以按预期操作。manage.py runserver
也可以按预期运行。我的版本:
- Python 3.7
- Django 3.0.3
- django-q 1.2.1
- PyCharm 2019.3.3 Pro