Bug fix - Fixed crash when deleting watch from UI when watch was already manually deleted from datadir (#1623)

pull/1626/head
dgtlmoon 2 years ago committed by GitHub
parent e62eeb1c4a
commit edb5e20de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -204,11 +204,12 @@ class ChangeDetectionStore:
# GitHub #30 also delete history records # GitHub #30 also delete history records
for uuid in self.data['watching']: for uuid in self.data['watching']:
path = pathlib.Path(os.path.join(self.datastore_path, uuid)) path = pathlib.Path(os.path.join(self.datastore_path, uuid))
if os.path.exists(path):
shutil.rmtree(path) shutil.rmtree(path)
self.needs_write_urgent = True
else: else:
path = pathlib.Path(os.path.join(self.datastore_path, uuid)) path = pathlib.Path(os.path.join(self.datastore_path, uuid))
if os.path.exists(path):
shutil.rmtree(path) shutil.rmtree(path)
del self.data['watching'][uuid] del self.data['watching'][uuid]

Loading…
Cancel
Save