Commit f8e11a91 authored by Administrator's avatar Administrator

[CLEAN] Removing celery tests and adapting countdown for ergonomic purpose.

parent 9641f8c5
from django.contrib import admin
# Register your models here.
from django.db import models
# Create your models here.
from celery import task
@task()
def add(x, y):
return x + y
from celery import task
from celery.contrib.methods import task_method
from celery import current_app
class Test(object):
@current_app.task(filter=task_method)
def addition(self, x, y):
#return "hello"
return int(x) + int(y)
@current_app.task()
def add(x, y):
return x + y
from django.test import TestCase
# Create your tests here.
from django.shortcuts import render
# Create your views here.
...@@ -17,7 +17,7 @@ PROJECT_PATH = os.path.abspath(PROJECT_PATH) ...@@ -17,7 +17,7 @@ PROJECT_PATH = os.path.abspath(PROJECT_PATH)
import djcelery import djcelery
djcelery.setup_loader() djcelery.setup_loader()
BROKER_URL = 'amqp://guest:guest@localhost:5672/' BROKER_URL = 'amqp://guest:guest@localhost:5672/'
CELERY_IMPORTS=("node.models","celerytest.tasks", "celerytest.task_simple") CELERY_IMPORTS=("node.models",)
# Quick-start development settings - unsuitable for production # Quick-start development settings - unsuitable for production
......
...@@ -228,7 +228,7 @@ def project(request, project_id): ...@@ -228,7 +228,7 @@ def project(request, project_id):
) )
try: try:
corpus.parse_resources.apply_async((), countdown=10) corpus.parse_resources.apply_async((), countdown=1)
except Exception as error: except Exception as error:
print(error) print(error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment