Skip to content

Commit

Permalink
Make safe_start_capture actually safe
Browse files Browse the repository at this point in the history
The method safe_start_capture would still throw an exception if the
agent state could not be set (e.g. due to a network error) which could
cause the capture service to fail.
  • Loading branch information
lkiesow authored and shaardie committed Jun 26, 2020
1 parent 682b0f0 commit baa0561
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pyca/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,14 @@ def safe_start_capture(event):
try:
start_capture(event)
except Exception:
logger.error('Recording failed')
logger.error(traceback.format_exc())
# Update state
recording_state(event.uid, 'capture_error')
update_event_status(event, Status.FAILED_RECORDING)
set_service_status_immediate(Service.CAPTURE, ServiceStatus.IDLE)
logger.exception('Recording failed')
# Update current status in Opencast
try:
set_service_status_immediate(Service.CAPTURE, ServiceStatus.IDLE)
recording_state(event.uid, 'capture_error')
update_event_status(event, Status.FAILED_RECORDING)
except Exception:
logger.exception('Could not update recording status')


def recording_command(event):
Expand Down

0 comments on commit baa0561

Please sign in to comment.