mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 04:15:39 +01:00
Better webengine render process crash handling
This commit is contained in:
parent
72509e53e0
commit
871a3ec922
1 changed files with 5 additions and 2 deletions
|
|
@ -149,13 +149,16 @@ def __init__(self, parent=None):
|
|||
def render_process_terminated(self, termination_type, exit_code):
|
||||
if termination_type == QWebEnginePage.NormalTerminationStatus:
|
||||
return
|
||||
self.webengine_crash_message = 'The Qt WebEngine Render process crashed with termination type: {} and exit code: {}'.format(
|
||||
termination_type, exit_code)
|
||||
prints(self.webengine_crash_message)
|
||||
if self._last_reload_at is not None and monotonic() - self._last_reload_at < 2:
|
||||
self.render_process_failed.emit()
|
||||
print('The Qt WebEngine Render process crashed too often')
|
||||
prints('The Qt WebEngine Render process crashed too often')
|
||||
else:
|
||||
self._last_reload_at = monotonic()
|
||||
self.render_process_restarted.emit()
|
||||
prints('The Qt WebEngine Render process crashed, restarting it')
|
||||
prints('Restarting Qt WebEngine')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in a new issue