Private
Public Access
1
0

moving cp calc to low prio queue

This commit is contained in:
Sander Roosendaal
2021-01-09 16:02:04 +01:00
parent 251a138c1d
commit 7b89fc7a45

View File

@@ -1163,10 +1163,12 @@ def calculate_goldmedalstandard(rower,workout,recurrance=True):
try: try:
df = pd.read_parquet(cpfile) df = pd.read_parquet(cpfile)
except: except:
df, delta, cpvalues = setcp(workout) df, delta, cpvalues = setcp(workout,background=True)
if df.empty:
return 0,0
if df.empty and recurrance: if df.empty and recurrance:
df, delta, cpvalues = setcp(workout,recurrance=False) df, delta, cpvalues = setcp(workout,recurrance=False,background=True)
if df.empty: if df.empty:
return 0,0 return 0,0
@@ -1200,7 +1202,7 @@ def calculate_goldmedalstandard(rower,workout,recurrance=True):
) )
) )
jsondf = df2.to_json() jsondf = df2.to_json()
job = myqueue(queue,handle_getagegrouprecords, job = myqueue(queuelow,handle_getagegrouprecords,
jsondf,distances,durations,age,rower.sex,rower.weightcategory) jsondf,distances,durations,age,rower.sex,rower.weightcategory)
wcpower = pd.Series(wcpower) wcpower = pd.Series(wcpower)