small improvements in c2import
This commit is contained in:
@@ -196,6 +196,7 @@ def get_c2_workouts(rower,do_async=True):
|
|||||||
knownc2ids = uniqify(knownc2ids+tombstones+parkedids)
|
knownc2ids = uniqify(knownc2ids+tombstones+parkedids)
|
||||||
|
|
||||||
newids = [c2id for c2id in c2ids if not c2id in knownc2ids]
|
newids = [c2id for c2id in c2ids if not c2id in knownc2ids]
|
||||||
|
print(newids,'aap')
|
||||||
|
|
||||||
newparkedids = uniqify(newids+parkedids)
|
newparkedids = uniqify(newids+parkedids)
|
||||||
|
|
||||||
@@ -203,6 +204,7 @@ def get_c2_workouts(rower,do_async=True):
|
|||||||
data = {'ids':newparkedids}
|
data = {'ids':newparkedids}
|
||||||
json.dump(data,c2blocked)
|
json.dump(data,c2blocked)
|
||||||
|
|
||||||
|
counter = 0
|
||||||
for c2id in newids:
|
for c2id in newids:
|
||||||
if do_async:
|
if do_async:
|
||||||
res = myqueue(queuehigh,
|
res = myqueue(queuehigh,
|
||||||
@@ -211,7 +213,9 @@ def get_c2_workouts(rower,do_async=True):
|
|||||||
rower.user.id,
|
rower.user.id,
|
||||||
rower.c2token,
|
rower.c2token,
|
||||||
c2id,
|
c2id,
|
||||||
|
counter
|
||||||
)
|
)
|
||||||
|
counter = counter+1
|
||||||
else:
|
else:
|
||||||
workoutid = create_async_workout(alldata,
|
workoutid = create_async_workout(alldata,
|
||||||
rower.user,c2id)
|
rower.user,c2id)
|
||||||
|
|||||||
@@ -2794,7 +2794,8 @@ def handle_rp3_async_workout(userid,rp3token,rp3id,startdatetime,debug=False,**k
|
|||||||
return workoutid
|
return workoutid
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def handle_c2_async_workout(alldata,userid,c2token,c2id,debug=False,**kwargs):
|
def handle_c2_async_workout(alldata,userid,c2token,c2id,delaysec,debug=False,**kwargs):
|
||||||
|
time.sleep(delaysec)
|
||||||
data = alldata[c2id]
|
data = alldata[c2id]
|
||||||
splitdata = None
|
splitdata = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user