Prevent StuckProjectImportJobsWorker from marking active migrations as stuck - GitHub Import
As mentioned in https://gitlab.com/gitlab-org/manage/import-and-integrate/discussions/-/issues/61#note_1650517323, StuckProjectImportJobsWorker can incorrectly mark imports as stuck if project.import_state.refresh_jid_expiration isn't called within 24 hours.
This problem can occur in two situations:
- The stage worker is executed for more than 24 hours
- AdvanceStageWorker takes more than 24 hours to move to the next stage
Proposed solution
Call the refresh_jid_expiration in two places:
- After reading each GitHub API page
- Using RefreshImportJidWorkerwhen stage workers start
- Every time AdvanceWorkers executes and the number of pending jobs decreases.
Edited  by Rodrigo Tomonari