Skip to content

Commit 69ec6a2

Browse files
committed
Attempted fix for missing MHS 5s
1 parent 639b40f commit 69ec6a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ppagent/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def collect(self):
172172
# set the next time it should run
173173
conf['next_run'] += conf['interval']
174174

175-
if 'hashrate' in self.collectors and now >= self.collectors['hashrate']['next_run']:
175+
if mhs and 'hashrate' in self.collectors and now >= self.collectors['hashrate']['next_run']:
176176
conf = self.collectors['hashrate']
177177
self.queue.append([self.worker, 'hashrate', mhs, now])
178178

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

0 commit comments

Comments
 (0)