-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CELERY_RESULT_BACKEND = 'django-cache' is not working when CELERY_CACHE_BACKEND='default' points to a Database #230
Comments
I'm running into the same error. From my experimenting I have found so far that:
|
I've narrowed down the problem to django_celery_results/backends/cache.py. The CacheBackend class feeds a key item to get/set that is of type The following code
I will see if I can put this is a pull request, but no promises because I'm not familiar with the github pull mechanism |
* Use string values for django-chache keys. When django cache backend tests the key provided by django_celery_results, It wants to have str type value. byte values result in the following exception being raised: File "/opt/exaboard/eXaboard/lib/python3.6/site-packages/django/core/cache/backends/base.py", line 287, in memcache_key_warnings if ord(char) < 33 or ord(char) == 127: TypeError: ord() expected string of length 1, but int found * Remove old super call argument * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add test that saves key value in byte format * Syntax fix for test_convert_key_from_byte_to_str * Fixes based on flake8 failures * Fix t/unit/backends/test_cache.py:64:50: W291 trailing whitespace Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Hi,
I am trying to use Database for CELERY_RESULT_BACKEND and following this doc.
I set the following in settings.py
results are getting saved in redis correctly.
However, when I use Database in caching,
then I get the following error (after doing django migration),
Is this the expected behavior with Database as backend cache?
Please note that if I use,
Then it would work, as
django_celery_results
creates tables for it and results will be stored correctly. But this method is different from that of usingdjango-cache
The text was updated successfully, but these errors were encountered: