a test that "verifies" that the file renaming lock works and no inconsistencies are created.

This commit is contained in:
jonaswinkler
2020-12-08 21:08:44 +01:00
parent e428a8a008
commit 550a74347c
2 changed files with 48 additions and 1 deletions

View File

@@ -206,6 +206,8 @@ class Consumer(LoggingMixin):
document.archive_checksum = hashlib.md5(
f.read()).hexdigest()
# Don't save with the lock active. Saving will cause the file
# renaming logic to aquire the lock as well.
document.save()
# Delete the file only if it was successfully consumed