fixing bugs in asynchronous tasks
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user