Skip to content

Commit

Permalink
Upload button in backup mode
Browse files Browse the repository at this point in the history
This patch implements an upload option for the backup mode.  Event processing
will halt after recording as usual, but users will now see an option in the
user interface to upload a given event to Opencast manually.

Co-authored-by: Christian Greweling <[email protected]>
  • Loading branch information
CGreweling and Christian Greweling authored Feb 10, 2021
1 parent 5f909f9 commit 43e44a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
10 changes: 8 additions & 2 deletions pyca/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ def start_capture(db, upcoming_event):

# Set status
# If part files exist, its an partial recording
p = any([glob.glob(f'{f}-part-*') for f in files])
state = Status.PARTIAL_RECORDING if p else Status.FINISHED_RECORDING
part_files = any([glob.glob(f'{f}-part-*') for f in files])
if part_files:
state = Status.PARTIAL_RECORDING
elif config('agent', 'backup_mode'):
state = Status.PAUSED_AFTER_RECORDING
else:
state = Status.FINISHED_RECORDING

logger.info("Set %s to %s", event.uid, Status.str(state))
update_event_status(event, state)
recording_state(event.uid, 'capture_finished')
Expand Down
1 change: 1 addition & 0 deletions pyca/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Status(Constants):
FAILED_UPLOADING = 6
FINISHED_UPLOADING = 7
PARTIAL_RECORDING = 8
PAUSED_AFTER_RECORDING = 9


class ServiceStatus(Constants):
Expand Down
4 changes: 0 additions & 4 deletions pyca/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,5 @@ def control_loop():
def run():
'''Start the capture agent.
'''
# If we are a backup CA, we don't want to actually upload anything. So
# let's just quit here and do not run the ingest service at all.
if config('agent')['backup_mode']:
return

control_loop()
2 changes: 1 addition & 1 deletion ui/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<font-awesome-icon icon="exclamation-triangle" />
</span>
<span class=action
v-if="event.status == 'failed uploading'"
v-if="event.status == 'failed uploading' || event.status == 'paused after recording'"
v-on:click="retry_ingest(event)"
title="Retry upload">
<font-awesome-icon icon="sync" v-bind:class="{ 'fa-spin': event.processing }" />
Expand Down

0 comments on commit 43e44a7

Please sign in to comment.