Show More
@@ -486,13 +486,17 b' class HistorySavingThread(threading.Thread):' | |||
|
486 | 486 | |
|
487 | 487 | def run(self): |
|
488 | 488 | # We need a separate db connection per thread: |
|
489 | self.db = sqlite3.connect(self.history_manager.hist_file) | |
|
490 | while True: | |
|
491 | self.history_manager.save_flag.wait() | |
|
492 | if self.stop_now: | |
|
493 |
|
|
|
494 | self.history_manager.save_flag.clear() | |
|
495 |
self.history_manager. |
|
|
489 | try: | |
|
490 | self.db = sqlite3.connect(self.history_manager.hist_file) | |
|
491 | while True: | |
|
492 | self.history_manager.save_flag.wait() | |
|
493 | if self.stop_now: | |
|
494 | return | |
|
495 | self.history_manager.save_flag.clear() | |
|
496 | self.history_manager.writeout_cache(self.db) | |
|
497 | except Exception as e: | |
|
498 | print(("The history saving thread hit an unexpected error (%s)." | |
|
499 | "History will not be written to the database.") % repr(e)) | |
|
496 | 500 | |
|
497 | 501 | def stop(self): |
|
498 | 502 | """This can be called from the main thread to safely stop this thread. |
General Comments 0
You need to be logged in to leave comments.
Login now