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

Add cancel action to job admin #352

Open
jpmckinney opened this issue Apr 27, 2024 · 0 comments
Open

Add cancel action to job admin #352

jpmckinney opened this issue Apr 27, 2024 · 0 comments
Labels

Comments

@jpmckinney
Copy link
Member

jpmckinney commented Apr 27, 2024

To avoid concurrency issues (e.g. manageprocess updating a job at the same time), the admin can set a flag on the job (similar to how keep_all_data operates as a flag to control the manageprocess command's behavior). When the flag is present, the command will run a new cancel method on the TaskManager instances, and then mark the job as ended. This should only operate on incomplete jobs, and it should run before creating new jobs. (In the admin, the new flag can be disabled for complete jobs.)

The cancel method would be a no-op for all except Collect, since those others use RabbitMQ. For Collect, it would cancel the job in Scrapyd (taking the code out of wipe).

The wipe method should call cancel, since the intention when wiping is never to leave the task running. (This also avoids having to remember to call cancel from every place wipe is called.)

As part of this issue, make the status field uneditable on the Job and Task admins. Update the docs that refer to set.*Status. Mention that cancelling a job also cancels the Scrapyd job.

Update the docs that refer to this issue (#352) and surrounding text.

Add relevant tests first #128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant