Private
Public Access
1
0

tasks updated

This commit is contained in:
Sander Roosendaal
2019-12-23 21:30:26 +01:00
parent 2388edcf6d
commit 9b653d4d1b

View File

@@ -618,6 +618,16 @@ def handle_calctrimp(id,
normv = 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(
target='localhost:50052',
options=[('grpc.lb_policy_name', 'pick_first'),
@@ -631,7 +641,7 @@ def handle_calctrimp(id,
stub = metrics_pb2_grpc.MetricsStub(channel)
req = metrics_pb2.WorkoutMetricsRequest(
filename = csvfilename,
filename = csvfile,
ftp=ftp,
sex=sex,
hrftp=hrftp,
@@ -645,6 +655,7 @@ def handle_calctrimp(id,
trimp = response.trimp
normv = response.normv
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(