Private
Public Access
1
0

improved standalone tasks

This commit is contained in:
Sander Roosendaal
2017-05-10 16:57:12 +02:00
parent e40db4c55c
commit ac2bdbce3d
3 changed files with 5 additions and 17 deletions

View File

@@ -1,7 +1,5 @@
if __name__ == '__main__':
import django
from django.conf import settings
django.setup()
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rowsandall_app.settings")
import time
from celery import app
@@ -13,7 +11,7 @@ from django.contrib.auth.models import User
@app.task
@job
def addcomment2(userid,id):
print 'aap'
print 'aap met standalone'
time.sleep(5)
w = Workout.objects.get(id=id)
w.notes += '\n the task has run'