-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Overview
Sometimes, if something abnormal occurs, like the Kolibri job that is running the sync finalization in background gets killed abruptly, we need to reset some values on the sync and transfer sessions in order to use kolibri's resumesync
command. I'd like a management command which resets the state (stage and status, along with sync-extras metadata) so that can resume at the stage it was interrupted.
Description and outcomes
A new management command reset_sync
should exist which should:
- Accept a script argument
--sync-session-id
- Check
SyncSession.process_id
to ensure that process isn't still running - Accept a script argument
--force
which bypasses theprocess_id
check - Update the in-progress
TransferSession
fieldstransfer_stage
andtransfer_stage_status
to the previous stage andCOMPLETED
respectively - Update the
extra_fields
onSyncSession
to remove the<transfer_session_id>_<transfer_stage>_job_id
key for the stage theTransferSession
was interrupted