Minor airtime_analyzer error handling improvements and documentation

This commit is contained in:
Albert Santoni 2015-04-06 17:22:13 -04:00
parent 3e2cd54be7
commit 492a7f329a
3 changed files with 3 additions and 3 deletions

View file

@ -233,7 +233,7 @@ class MessageListener:
AnalyzerPipeline.run_analysis(q, audio_file_path, import_directory, original_filename, storage_backend, file_prefix, cloud_storage_config) AnalyzerPipeline.run_analysis(q, audio_file_path, import_directory, original_filename, storage_backend, file_prefix, cloud_storage_config)
results = q.get() results = q.get()
except Exception as e: except Exception as e:
logging.error("Analyzer pipeline exception", e) logging.error("Analyzer pipeline exception: %s" % str(e))
pass pass
# Ensure our queue doesn't fill up and block due to unexpected behaviour. Defensive code. # Ensure our queue doesn't fill up and block due to unexpected behaviour. Defensive code.

View file

@ -27,6 +27,6 @@ class PlayabilityAnalyzer(Analyzer):
logging.warn("Failed to run: %s - %s. %s" % (command[0], e.strerror, "Do you have liquidsoap installed?")) logging.warn("Failed to run: %s - %s. %s" % (command[0], e.strerror, "Do you have liquidsoap installed?"))
except (subprocess.CalledProcessError, Exception) as e: # liquidsoap returned an error code except (subprocess.CalledProcessError, Exception) as e: # liquidsoap returned an error code
logging.warn(e) logging.warn(e)
raise UnplayableFileError raise UnplayableFileError()
return metadata return metadata

View file

@ -25,7 +25,7 @@ class PicklableHttpRequest:
auth=requests.auth.HTTPBasicAuth(self.api_key, '')) auth=requests.auth.HTTPBasicAuth(self.api_key, ''))
def process_http_requests(ipc_queue, http_retry_queue_path): def process_http_requests(ipc_queue, http_retry_queue_path):
''' Runs in a separate process and performs all the HTTP requests where we're ''' Runs in a separate thread and performs all the HTTP requests where we're
reporting extracted audio file metadata or errors back to the Airtime web application. reporting extracted audio file metadata or errors back to the Airtime web application.
This process also checks every 5 seconds if there's failed HTTP requests that we This process also checks every 5 seconds if there's failed HTTP requests that we