Skip to content

Commit

Permalink
Attempted fix for missing MHS 5s
Browse files Browse the repository at this point in the history
  • Loading branch information
icook committed Mar 18, 2014
1 parent 639b40f commit 69ec6a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ppagent/main.py
Expand Up @@ -172,7 +172,7 @@ def collect(self):
# set the next time it should run
conf['next_run'] += conf['interval']

if 'hashrate' in self.collectors and now >= self.collectors['hashrate']['next_run']:
if mhs and 'hashrate' in self.collectors and now >= self.collectors['hashrate']['next_run']:
conf = self.collectors['hashrate']
self.queue.append([self.worker, 'hashrate', mhs, now])

Expand Down Expand Up @@ -227,7 +227,7 @@ def call_devs(self):
mhs = [round(now['Total MH'] - last['Total MH'], 3)
for now, last in zip(data['DEVS'], self.last_devs)]
else:
mhs = [d['MHS 5s'] for d in data['DEVS']]
mhs = [d.get('MHS 5s') for d in data['DEVS'] if 'MHS 5s' in d]
self.last_devs = data['DEVS']
return mhs, temps, details

Expand Down

0 comments on commit 69ec6a2

Please sign in to comment.