From 8564630595eda70229aa1cfd130856cbc2f47d08 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sun, 4 Jan 2015 12:25:59 -0500 Subject: [PATCH] weatherApp: error handling --- iocBoot/iocweatherbnl/st.cmd | 4 ++++ weatherApp/weather.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/iocBoot/iocweatherbnl/st.cmd b/iocBoot/iocweatherbnl/st.cmd index 8756ad5..0e52d50 100755 --- a/iocBoot/iocweatherbnl/st.cmd +++ b/iocBoot/iocweatherbnl/st.cmd @@ -15,3 +15,7 @@ dbLoadRecords("db/weather.db","P=CF:Ext{UNNT},LOC=UNNT") iocInit() dbl > weather.dbl +system "cp weather.dbl /cf-update/${HOSTNAME}.${IOCNAME}.dbl" + +# Start Reference tracker +py "from devsup import disect; disect.periodic(10)" diff --git a/weatherApp/weather.py b/weatherApp/weather.py index ddb52c7..14bca61 100644 --- a/weatherApp/weather.py +++ b/weatherApp/weather.py @@ -129,7 +129,7 @@ class ReportScanner(StoppableThread): rtime = iso2sec(report.getISOTime()) report._updatetime = rtime - print('update',report.getISOTime(),rtime,self.lastUpdate) + #print('update',report.getISOTime(),rtime,self.lastUpdate) if self.lastUpdate is not None: if self.lastUpdate >= rtime: @@ -147,7 +147,7 @@ class ReportScanner(StoppableThread): self.lastUpdate = rtime - except (socket.error, urllib2.URLError) as e: + except Exception as e: print("download error for",self.station,":",e) self.updatePeriod = self.initPeriod