Skip to content

Commit

Permalink
Merge pull request #3934 from xoriole/issue_3933
Browse files Browse the repository at this point in the history
Fixed CPU history bug in debug endpoint
  • Loading branch information
devos50 committed Oct 4, 2018
2 parents b439d10 + 90c373a commit 30b17a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tribler/Core/Modules/restapi/debug_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ def render_GET(self, request):
}, ...]
}
"""
return json.dumps({"cpu_history": self.session.lm.resource_monitor.get_cpu_history_dict()})
history = self.session.lm.resource_monitor.get_cpu_history_dict() if self.session.lm.resource_monitor else {}
return json.dumps({"cpu_history": history})


class DebugMemoryEndpoint(resource.Resource):
Expand Down
1 change: 1 addition & 0 deletions TriblerGUI/debug_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ def on_memory_dump_data_available(self, filename, data):
"An error occurred when exporting the torrent file: %s" % str(exc))

def closeEvent(self, close_event):
self.request_mgr.cancel_request()
if self.cpu_plot_timer:
self.cpu_plot_timer.stop()

Expand Down

0 comments on commit 30b17a7

Please sign in to comment.