Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New management command reset_sync for killed sync issues #7

Open
bjester opened this issue Jul 21, 2023 · 0 comments
Open

New management command reset_sync for killed sync issues #7

bjester opened this issue Jul 21, 2023 · 0 comments

Comments

@bjester
Copy link
Member

bjester commented Jul 21, 2023

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 the process_id check
  • Update the in-progress TransferSession fields transfer_stage and transfer_stage_status to the previous stage and COMPLETED respectively
  • Update the extra_fields on SyncSession to remove the <transfer_session_id>_<transfer_stage>_job_id key for the stage the TransferSession was interrupted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant