chg: out of safety, do not remove a capture dir.

pull/254/head
Raphaël Vinot 2021-08-30 12:54:17 +02:00
parent 117500b777
commit e56c70d1a1
1 changed files with 3 additions and 2 deletions

View File

@ -57,8 +57,9 @@ class Archiver(AbstractManager):
current_index[_f.read().strip()] = uuid_file.parent.name current_index[_f.read().strip()] = uuid_file.parent.name
if not current_index: if not current_index:
# The directory has been archived. # The directory has been archived. It is probably safe to unlink, but
root_dir.unlink() # if it's not, we will lose a whole buch of captures. Moving instead for safety.
root_dir.rename(get_homedir() / 'discarded_captures' / root_dir.name)
return return
with index_file.open('w') as _f: with index_file.open('w') as _f: