mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 00:57:09 +01:00
locking media directory while deleting files
This commit is contained in:
parent
6003122b06
commit
70cbdbf23b
1 changed files with 22 additions and 21 deletions
|
|
@ -171,6 +171,7 @@ def run_post_consume_script(sender, document, **kwargs):
|
|||
|
||||
@receiver(models.signals.post_delete, sender=Document)
|
||||
def cleanup_document_deletion(sender, instance, using, **kwargs):
|
||||
with FileLock(settings.MEDIA_LOCK):
|
||||
for f in (instance.source_path,
|
||||
instance.archive_path,
|
||||
instance.thumbnail_path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue