forked from 0x2620/pandora
update celery to a version that works in python3.7
This commit is contained in:
parent
de14061b68
commit
62fe578f38
4 changed files with 9 additions and 9 deletions
|
@ -10,7 +10,7 @@ from django.db.models import Count, Q
|
|||
|
||||
from six import string_types
|
||||
from celery.utils import get_full_cls_name
|
||||
from celery.backends import default_backend
|
||||
from celery._state import current_app
|
||||
import ox
|
||||
from oxdjango.decorators import login_required_json
|
||||
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
||||
|
@ -390,8 +390,11 @@ def getTaskStatus(request, data):
|
|||
else:
|
||||
task_id = data['task_id']
|
||||
response = json_response(status=200, text='ok')
|
||||
status = default_backend.get_status(task_id)
|
||||
res = default_backend.get_result(task_id)
|
||||
|
||||
backend = current_app.backend
|
||||
status = backend.get_status(task_id)
|
||||
res = backend.get_result(task_id)
|
||||
|
||||
response['data'] = {
|
||||
'id': task_id,
|
||||
'status': status
|
||||
|
|
|
@ -6,8 +6,6 @@ from __future__ import absolute_import
|
|||
|
||||
import os
|
||||
from os.path import join, normpath, dirname
|
||||
import djcelery
|
||||
djcelery.setup_loader()
|
||||
|
||||
BASE_DIR = PROJECT_ROOT = normpath(dirname(__file__))
|
||||
BIN_DIR = normpath(join(PROJECT_ROOT, '..', 'bin'))
|
||||
|
@ -122,7 +120,7 @@ INSTALLED_APPS = (
|
|||
'django.contrib.humanize',
|
||||
|
||||
'django_extensions',
|
||||
'djcelery',
|
||||
'django_celery_results',
|
||||
'app',
|
||||
'log',
|
||||
'annotation',
|
||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, print_function, absolute_import
|
|||
from datetime import datetime, timedelta
|
||||
from time import time
|
||||
|
||||
from celery.backends import default_backend
|
||||
from celery.utils import get_full_cls_name
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.conf import settings
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Django==1.11.22
|
||||
simplejson
|
||||
chardet
|
||||
celery==3.1.26.post2
|
||||
django-celery==3.2.2
|
||||
celery>4
|
||||
django-celery-results
|
||||
django-extensions==2.0.7
|
||||
gunicorn==19.8.1
|
||||
html5lib
|
||||
|
|
Loading…
Reference in a new issue