alternative approach
This commit is contained in:
@@ -100,7 +100,7 @@ from rowers.tasks import handle_makeplot,handle_otwsetpower,handle_sendemailtcx,
|
||||
from rowers.tasks import (
|
||||
handle_sendemail_unrecognized,handle_sendemailnewcomment,
|
||||
handle_sendemailnewresponse, handle_updatedps,
|
||||
handle_updatecp,long_test_task
|
||||
handle_updatecp,long_test_task,long_test_task2
|
||||
)
|
||||
|
||||
from scipy.signal import savgol_filter
|
||||
@@ -269,6 +269,7 @@ verbose_job_status = {
|
||||
'otwsetpower': 'Rowing Physics OTW Power Calculation',
|
||||
'make_plot': 'Create static chart',
|
||||
'long_test_task': 'Long Test Task',
|
||||
'long_test_task2': 'Long Test Task 2',
|
||||
}
|
||||
|
||||
def get_job_status(jobid):
|
||||
@@ -344,7 +345,31 @@ def test_job_view(request,aantal=100):
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
|
||||
@login_required()
|
||||
def test_job_view2(request,aantal=100):
|
||||
|
||||
|
||||
job = myqueue(queuehigh,long_test_task2,int(aantal))
|
||||
|
||||
|
||||
try:
|
||||
request.session['async_tasks'] += [(job.id,'long_test_task2')]
|
||||
except KeyError:
|
||||
request.session['async_tasks'] = [(job.id,'long_test_task2')]
|
||||
|
||||
url = reverse(session_jobs_status)
|
||||
|
||||
return HttpResponseRedirect(url)
|
||||
|
||||
def post_progress(request,id=None,value=0):
|
||||
if id:
|
||||
cache.set(id,value,3600)
|
||||
|
||||
# test
|
||||
result = cache.get(id)
|
||||
|
||||
return HttpResponse('progress cached '+str(result),status=200)
|
||||
|
||||
def get_all_queued_jobs(userid=0):
|
||||
r = StrictRedis()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user