Print timing information for shutdown in debug mode

Fixes #2654 (Add shutdown log message)
This commit is contained in:
Kovid Goyal 2025-02-06 20:45:22 +05:30
parent 54ab4e3863
commit 0e58469834
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1237,6 +1237,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
return True
def shutdown(self, write_settings=True):
timed_print('Shutdown starting...')
self.shutting_down = True
if hasattr(self.library_view, 'connect_to_book_display_timer'):
self.library_view.connect_to_book_display_timer.stop()
@ -1322,11 +1323,12 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
self.istores.join()
wait_for_cleanup()
wait_for_stop()
self.shutdown_completed.emit()
timed_print('Shutdown complete, quitting...')
try:
sys.stdout.flush() # Make sure any buffered prints are written for debug mode
except Exception:
pass
self.shutdown_completed.emit()
return True
def run_wizard(self, *args):