Skip to content

Conversation

@tw4l
Copy link
Member

@tw4l tw4l commented Nov 20, 2023

Fixes #1395

Adds new POST /orgs/jobs/retryFailed API endpoint to retry all failed background jobs.

Tested manually on local dev instance by setting invalid secret key for replica storage, starting a few crawls/uploads, waiting for replica jobs to fail, then calling new endpoint and verifying via GET /orgs/jobs that the failed jobs were restarted.

@tw4l tw4l requested a review from ikreymer November 20, 2023 21:38
@ikreymer
Copy link
Member

Nice! Could we also add an endpoint to retry all failed jobs, accessible only for superadmin? Perhaps /api/orgs/all/retryAllFailed?

@tw4l
Copy link
Member Author

tw4l commented Nov 27, 2023

Nice! Could we also add an endpoint to retry all failed jobs, accessible only for superadmin? Perhaps /api/orgs/all/retryAllFailed?

Yeah, good call! Added POST /orgs/all/jobs/retryFailed to make the superuser all endpoint consistent with the other ones we have. Tested and working well! Also added a missing oid query to the org-specific endpoint.

@tw4l tw4l force-pushed the issue-1395-retry-all-failed-bg-jobs branch 3 times, most recently from 518874b to 7450c8e Compare November 27, 2023 14:34
emma-sg added a commit that referenced this pull request Nov 27, 2023
Fixes builds failing because of a webpack dependency not being installed
when `--production` flag is used with yarn, e.g. here
#1396
@tw4l
Copy link
Member Author

tw4l commented Nov 27, 2023

Added and tested a nightly test to ensure that non-superusers get a 403 when calling POST /orgs/all/jobs/retryFailed

@tw4l tw4l force-pushed the issue-1395-retry-all-failed-bg-jobs branch from b42d52a to b843930 Compare November 29, 2023 21:56
@tw4l
Copy link
Member Author

tw4l commented Dec 1, 2023

@ikreymer could use your eyes when you have a moment

@ikreymer ikreymer merged commit 478b794 into main Dec 5, 2023
@ikreymer ikreymer deleted the issue-1395-retry-all-failed-bg-jobs branch December 5, 2023 21:00
tw4l added a commit that referenced this pull request Dec 12, 2023
Fixes #1395 

- Adds new `POST /orgs/<orgid>/jobs/retryFailed` API endpoint to retry all failed
background jobs for a specific org.
- Also adds `POST /orgs/all/jobs/retryFailed` for superadmin to retry all failed background jobs for all orgs
tw4l added a commit that referenced this pull request Dec 19, 2023
Fixes #1395 

- Adds new `POST /orgs/<orgid>/jobs/retryFailed` API endpoint to retry all failed
background jobs for a specific org.
- Also adds `POST /orgs/all/jobs/retryFailed` for superadmin to retry all failed background jobs for all orgs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API endpoint to retry all failed background jobs

3 participants