c2 to async
This commit is contained in:
@@ -75,7 +75,7 @@ def strip_tags(html):
|
||||
|
||||
from rowers.dataprepnodjango import (
|
||||
update_strokedata, new_workout_from_file,
|
||||
getsmallrowdata_db, updatecpdata_sql,
|
||||
getsmallrowdata_db, updatecpdata_sql,update_c2id_sql,
|
||||
update_agegroup_db,fitnessmetric_to_sql,
|
||||
add_c2_stroke_data_db,totaltime_sec_to_string,
|
||||
create_c2_stroke_data_db,update_empower,
|
||||
@@ -121,7 +121,18 @@ def add(x, y):
|
||||
return x + y
|
||||
|
||||
|
||||
@app.task
|
||||
def handle_c2_sync(workoutid,url,headers,data,debug=True,**kwargs):
|
||||
response = requests.post(url,headers=headers,data=data)
|
||||
if response.status_code not in [200,201]:
|
||||
return 0
|
||||
|
||||
s = response.json()
|
||||
c2id = s['data']['id']
|
||||
|
||||
res = update_c2id_sql(workoutid,c2id)
|
||||
|
||||
return res
|
||||
|
||||
@app.task
|
||||
def handle_c2_import_stroke_data(c2token,
|
||||
|
||||
Reference in New Issue
Block a user