Merge branch 'release/v4.79'
This commit is contained in:
@@ -916,7 +916,10 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
||||
f_to_be_deleted = f2
|
||||
# should delete file
|
||||
f2 = f2[:-4] + 'o.csv'
|
||||
row.write_csv(f2, gzip=True)
|
||||
try:
|
||||
row.write_csv(f2, gzip=True)
|
||||
except:
|
||||
return (0,0,0,0)
|
||||
|
||||
# os.remove(f2)
|
||||
try:
|
||||
@@ -1009,6 +1012,9 @@ def new_workout_from_file(r, f2,
|
||||
f2, summary, oarlength, inboard = handle_nonpainsled(f2,
|
||||
fileformat,
|
||||
summary=summary)
|
||||
if not f2:
|
||||
message = 'Something went wrong'
|
||||
return (0, message, '')
|
||||
except:
|
||||
errorstring = str(sys.exc_info()[0])
|
||||
message = 'Something went wrong: ' + errorstring
|
||||
|
||||
@@ -13,6 +13,7 @@ import threading
|
||||
import requests
|
||||
|
||||
from rowsandall_app.settings import SITE_URL
|
||||
from rowsandall_app.settings_dev import SITE_URL as SITE_URL_DEV
|
||||
|
||||
def getvalue(data):
|
||||
perc = 0
|
||||
@@ -73,7 +74,11 @@ def longtask2(aantal,jobid=None,debug=False):
|
||||
if debug:
|
||||
print progress
|
||||
if jobid != None:
|
||||
url = SITE_URL+"/rowers/record-progress/"
|
||||
if debug:
|
||||
url = SITE_URL_DEV
|
||||
else:
|
||||
url = SITE_URL
|
||||
url += "/rowers/record-progress/"
|
||||
url += str(progress)+"/"+jobid
|
||||
s = requests.get(url)
|
||||
if debug:
|
||||
|
||||
@@ -53,10 +53,17 @@ def long_test_task(self,aantal,debug=False,job=None,session_key=None):
|
||||
session_key=session_key)
|
||||
|
||||
@app.task(bind=True)
|
||||
def long_test_task2(self,aantal,debug=False,job=None):
|
||||
def long_test_task2(self,aantal,**kwargs):
|
||||
#debug=False,job=None,jobid='aap'):
|
||||
job = self.request
|
||||
|
||||
return longtask.longtask2(aantal,jobid=job.id,debug=debug)
|
||||
job_id = job.id
|
||||
|
||||
if 'jobkey' in kwargs:
|
||||
job_id = kwargs.pop('jobkey')
|
||||
|
||||
kwargs['jobid'] = job_id
|
||||
|
||||
return longtask.longtask2(aantal,**kwargs)
|
||||
|
||||
# create workout
|
||||
@app.task
|
||||
|
||||
@@ -4,7 +4,7 @@ import pandas as pd
|
||||
import colorsys
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
import uuid
|
||||
|
||||
lbstoN = 4.44822
|
||||
|
||||
@@ -224,6 +224,9 @@ def myqueue(queue,function,*args,**kwargs):
|
||||
kwargs['debug'] = True
|
||||
job = function.delay(*args,**kwargs)
|
||||
else:
|
||||
job_id = str(uuid.uuid4())
|
||||
kwargs['job_id'] = job_id
|
||||
kwargs['jobkey'] = job_id
|
||||
job = queue.enqueue(function,*args,**kwargs)
|
||||
|
||||
return job
|
||||
|
||||
Reference in New Issue
Block a user