stop and join watchdog observer (#11706)

This is in accordance with the example.  For inotify at least the `.stop()`
call ends up calling the removed unschedule call anyways.

72f2eb7203 (example-api-usage)
This commit is contained in:
Kyle Altendorf 2022-06-08 11:20:08 -04:00 committed by GitHub
parent 69ea31f509
commit 61fa0edc02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -174,7 +174,8 @@ class FileKeyring(FileSystemEventHandler):
def cleanup_keyring_file_watcher(self):
if getattr(self, "keyring_observer"):
self.keyring_observer.unschedule_all()
self.keyring_observer.stop()
self.keyring_observer.join()
def on_modified(self, event):
self.check_if_keyring_file_modified()