mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Don't do decoding work if not needed
This commit is contained in:
		
							parent
							
								
									057f6016cc
								
							
						
					
					
						commit
						3dfeee9332
					
				@ -537,6 +537,7 @@ class Consumer(LoggingMixin):
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
        # Decode the output (if any)
 | 
			
		||||
        if len(completed_process.stdout):
 | 
			
		||||
            stdout_str = (
 | 
			
		||||
                completed_process.stdout.decode("utf8", errors="ignore")
 | 
			
		||||
                .strip()
 | 
			
		||||
@ -544,6 +545,11 @@ class Consumer(LoggingMixin):
 | 
			
		||||
                    "\n",
 | 
			
		||||
                )
 | 
			
		||||
            )
 | 
			
		||||
            self.log("info", "Script stdout:")
 | 
			
		||||
            for line in stdout_str:
 | 
			
		||||
                self.log("info", line)
 | 
			
		||||
 | 
			
		||||
        if len(completed_process.stderr):
 | 
			
		||||
            stderr_str = (
 | 
			
		||||
                completed_process.stderr.decode("utf8", errors="ignore")
 | 
			
		||||
                .strip()
 | 
			
		||||
@ -552,12 +558,6 @@ class Consumer(LoggingMixin):
 | 
			
		||||
                )
 | 
			
		||||
            )
 | 
			
		||||
 | 
			
		||||
        if len(stdout_str):
 | 
			
		||||
            self.log("info", "Script stdout:")
 | 
			
		||||
            for line in stdout_str:
 | 
			
		||||
                self.log("info", line)
 | 
			
		||||
 | 
			
		||||
        if len(stderr_str):
 | 
			
		||||
            self.log("warning", "Script stderr:")
 | 
			
		||||
            for line in stderr_str:
 | 
			
		||||
                self.log("warning", line)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user