tasks updated
This commit is contained in:
@@ -618,6 +618,16 @@ def handle_calctrimp(id,
|
|||||||
normv = 0
|
normv = 0
|
||||||
normw = 0
|
normw = 0
|
||||||
|
|
||||||
|
# check what the real file name is
|
||||||
|
if os.path.exists(csvfilename):
|
||||||
|
csvfile = csvfilename
|
||||||
|
elif os.path.exists(csvfilename+'.csv'):
|
||||||
|
csvfile = csvfilename+'.csv'
|
||||||
|
elif os.path.exists(csvfilename+'.gz'):
|
||||||
|
csvfile = csvfilename+'.gz'
|
||||||
|
|
||||||
|
csvfile = os.path.abspath(csvfile)
|
||||||
|
|
||||||
with grpc.insecure_channel(
|
with grpc.insecure_channel(
|
||||||
target='localhost:50052',
|
target='localhost:50052',
|
||||||
options=[('grpc.lb_policy_name', 'pick_first'),
|
options=[('grpc.lb_policy_name', 'pick_first'),
|
||||||
@@ -631,7 +641,7 @@ def handle_calctrimp(id,
|
|||||||
|
|
||||||
stub = metrics_pb2_grpc.MetricsStub(channel)
|
stub = metrics_pb2_grpc.MetricsStub(channel)
|
||||||
req = metrics_pb2.WorkoutMetricsRequest(
|
req = metrics_pb2.WorkoutMetricsRequest(
|
||||||
filename = csvfilename,
|
filename = csvfile,
|
||||||
ftp=ftp,
|
ftp=ftp,
|
||||||
sex=sex,
|
sex=sex,
|
||||||
hrftp=hrftp,
|
hrftp=hrftp,
|
||||||
@@ -645,6 +655,7 @@ def handle_calctrimp(id,
|
|||||||
trimp = response.trimp
|
trimp = response.trimp
|
||||||
normv = response.normv
|
normv = response.normv
|
||||||
normw = response.normw
|
normw = response.normw
|
||||||
|
hrtss = response.hrtss
|
||||||
|
|
||||||
|
|
||||||
query = 'UPDATE rowers_workout SET rscore = {tss}, normp = {normp}, trimp={trimp}, hrtss={hrtss}, normv={normv}, normw={normw} WHERE id={id}'.format(
|
query = 'UPDATE rowers_workout SET rscore = {tss}, normp = {normp}, trimp={trimp}, hrtss={hrtss}, normv={normv}, normw={normw} WHERE id={id}'.format(
|
||||||
|
|||||||
Reference in New Issue
Block a user