Private
Public Access
1
0

fixing bugs in asynchronous tasks

This commit is contained in:
Sander Roosendaal
2019-12-22 20:13:30 +01:00
parent 724720aa39
commit 8109eee75f
2 changed files with 10 additions and 6 deletions

View File

@@ -1754,15 +1754,15 @@ def handle_updatefitnessmetric(user_id,mode,workoutids,debug=False,
def handle_updatecp(rower_id,workoutids,debug=False,table='cpdata',**kwargs):
columns = ['power','workoutid','time']
df = getsmallrowdata_db(columns,ids=workoutids,debug=debug)
dfgrouped = df.groupby(['workoutid'])
if not df.empty:
maxt = 1.05*df['time'].max()/1000.
else:
maxt = 1000.
if df.empty:
return 0
maxt = 1.05*df['time'].max()/1000.
logarr = datautils.getlogarr(maxt)
dfgrouped = df.groupby(['workoutid'])
delta,cpvalue,avgpower = datautils.getcp(dfgrouped,logarr)