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