diff --git a/rowers/c2stuff.py b/rowers/c2stuff.py index f857a67e..6b193151 100644 --- a/rowers/c2stuff.py +++ b/rowers/c2stuff.py @@ -196,6 +196,7 @@ def get_c2_workouts(rower,do_async=True): knownc2ids = uniqify(knownc2ids+tombstones+parkedids) newids = [c2id for c2id in c2ids if not c2id in knownc2ids] + print(newids,'aap') newparkedids = uniqify(newids+parkedids) @@ -203,6 +204,7 @@ def get_c2_workouts(rower,do_async=True): data = {'ids':newparkedids} json.dump(data,c2blocked) + counter = 0 for c2id in newids: if do_async: res = myqueue(queuehigh, @@ -211,7 +213,9 @@ def get_c2_workouts(rower,do_async=True): rower.user.id, rower.c2token, c2id, + counter ) + counter = counter+1 else: workoutid = create_async_workout(alldata, rower.user,c2id) diff --git a/rowers/tasks.py b/rowers/tasks.py index 21b1df20..aa5ef4dd 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -2794,7 +2794,8 @@ def handle_rp3_async_workout(userid,rp3token,rp3id,startdatetime,debug=False,**k return workoutid @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] splitdata = None