Private
Public Access
1
0

extra logging on intervals.icu

This commit is contained in:
2025-02-21 17:11:05 +01:00
parent 9767cc3bd3
commit afb207463b

View File

@@ -123,6 +123,7 @@ class IntervalsIntegration(SyncIntegration):
try:
row = rowingdata(csvfile=filename)
except IOError: # pragma: no cover
dologging('intervals.icu.log', "Could not open file {filename}".format(filename=filename))
data = dataprep.read_df_sql(w.id)
try:
datalength = len(data)
@@ -136,8 +137,10 @@ class IntervalsIntegration(SyncIntegration):
try:
row = rowingdata(csvfile=filename)
except IOError: # pragma: no cover
dologging('intervals.icu.log', "Could not open file {filename}".format(filename=filename))
return '' # pragma: no cover
else:
dologging('intervals.icu.log', "Could not create data for workout {id}".format(id=w.id))
return ''
tcxfilename = w.csvfilename[:-4] + '.tcx'
@@ -146,7 +149,7 @@ class IntervalsIntegration(SyncIntegration):
except TypeError:
newnotes = 'from'+w.workoutsource+' via rowsandall.com'
if w.user.intervals_resample_to_1s and w_resampled:
if w_resampled:
w_resampled.delete()
row.exporttotcx(tcxfilename, notes=newnotes, sport=mytypes.intervalsmapping[w.workouttype])
if dozip:
@@ -161,6 +164,7 @@ class IntervalsIntegration(SyncIntegration):
except WindowsError: # pragma: no cover
pass
except FileNotFoundError:
dologging('intervals.icu.log', "Could not open file {filename}".format(filename=tcxfilename))
return ''
return gzfilename
@@ -177,6 +181,7 @@ class IntervalsIntegration(SyncIntegration):
filename = self.createworkoutdata(workout)
if not filename:
dologging('intervals.icu.log', "Could not create data for workout {id}".format(id=workout.id))
return 0
params = {
@@ -227,6 +232,7 @@ class IntervalsIntegration(SyncIntegration):
response = requests.put(url, headers=headers, json=jsondict)
if response.status_code not in [200, 201]:
dologging('intervals.icu.log', response.reason)
return 0