Skip to content

Commit

Permalink
Fixed up celery worker thread start and incorrect model name
Browse files Browse the repository at this point in the history
  • Loading branch information
nuwang committed Oct 12, 2018
1 parent 0bf15d9 commit ea8b5ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions django-cloudlaunch/cloudlaunchserver/apps.py
Expand Up @@ -18,12 +18,10 @@ def ready(self):
# https://stackoverflow.com/questions/22233680/in-memory-broker-for-celery-unit-tests
# Also refer: https://github.com/celery/celerytest
app.control.purge()
celery_worker = app.Worker(app=app, pool='solo', concurrency=1)
#connections.close_all()
worker_thread = threading.Thread(target=celery_worker.start)
worker_thread = threading.Thread(target=app.worker_main)
worker_thread.daemon = True
worker_thread.start()

@receiver(django_server_shutdown)
def on_shutdown(sender, **kwargs):
# Do nothing. Calling stop results in celery hanging waiting for keyboard input
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/initial_test_data.json
Expand Up @@ -18,7 +18,7 @@
}
},
{
"model": "cloudlaunch.token",
"model": "cloudlaunch.authtoken",
"pk": "1",
"fields": {
"user": 3000,
Expand Down

0 comments on commit ea8b5ec

Please sign in to comment.