]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Includes the actual OSError string in the log, instead of assuming it's a busy file 1220/head
authorTrenton Holmes <holmes.trenton@gmail.com>
Mon, 11 Jul 2022 18:57:02 +0000 (11:57 -0700)
committerTrenton Holmes <holmes.trenton@gmail.com>
Mon, 11 Jul 2022 18:57:02 +0000 (11:57 -0700)
src/documents/management/commands/document_consumer.py

index bddb566aaeebe9b4f35977d04d3ee4deb11e5be7..baa14f166e38fd2a1d78674de25dbfcb74221fef 100644 (file)
@@ -67,17 +67,19 @@ def _consume(filepath):
 
     read_try_count = 0
     file_open_ok = False
+    os_error_str = None
 
     while (read_try_count < os_error_retry_count) and not file_open_ok:
         try:
             with open(filepath, "rb"):
                 file_open_ok = True
-        except OSError:
+        except OSError as e:
             read_try_count += 1
+            os_error_str = str(e)
             sleep(os_error_retry_wait)
 
     if read_try_count >= os_error_retry_count:
-        logger.warning(f"Not consuming file {filepath}: OS reports file as busy still")
+        logger.warning(f"Not consuming file {filepath}: OS reports {os_error_str}")
         return
 
     tag_ids = None