diff options
author | adityacp | 2020-04-20 17:40:54 +0530 |
---|---|---|
committer | adityacp | 2020-04-20 17:40:54 +0530 |
commit | dde62c0da11af928ac1c5ff078c52db739aa090b (patch) | |
tree | 46c1bca22818ef2a4da8e6fbe1942d1642396b2f /online_test/celery.py | |
parent | aa55eca2e8c745ef22226b4e41eae5f060154aa1 (diff) | |
download | online_test-dde62c0da11af928ac1c5ff078c52db739aa090b.tar.gz online_test-dde62c0da11af928ac1c5ff078c52db739aa090b.tar.bz2 online_test-dde62c0da11af928ac1c5ff078c52db739aa090b.zip |
Change celery.py, settings.py, requirements-common.txt test_views.py
- Add ping task in celery.py
- Add celery result backend in settings.py
- Add celery related packages in common requirements
- Add celery worker in regrade test class to run the worker with the test
Diffstat (limited to 'online_test/celery.py')
-rw-r--r-- | online_test/celery.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/online_test/celery.py b/online_test/celery.py index 582f8a1..ac6e395 100644 --- a/online_test/celery.py +++ b/online_test/celery.py @@ -17,3 +17,9 @@ app.config_from_object('django.conf:settings', namespace='CELERY') # Load task modules from all registered Django app configs. app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) + +@app.task(name='celery.ping') +def ping(): + # type: () -> str + """Simple task that just returns 'pong'.""" + return 'pong'
\ No newline at end of file |