-
Notifications
You must be signed in to change notification settings - Fork 9
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
mrc-3167: Add function to cancel reports running on remote #314
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ export(orderly_bundle_list) | |
export(orderly_bundle_pack) | ||
export(orderly_bundle_pack_remote) | ||
export(orderly_bundle_run) | ||
export(orderly_cancel_remote) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be |
||
export(orderly_cleanup) | ||
export(orderly_commit) | ||
export(orderly_config) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -662,3 +662,29 @@ pull_info <- function(name, id, root, locate, remote, parameters) { | |
config = config, | ||
remote = remote) | ||
} | ||
|
||
|
||
##' Cancel a report | ||
##' | ||
##' The action will depend on the status of the report: | ||
##' * queued - report run will be deleted | ||
##' * running - report run will be cancelled | ||
##' * complete/errored - no effect | ||
##' | ||
##' @param keys The key or keys for the reports to cancel | ||
##' | ||
##' @inheritParams orderly_pull_dependencies | ||
##' | ||
##' @return List with names as report keys and values are lists containing | ||
##' * `killed` - boolean TRUE if report successfully cancelled, FALSE | ||
##' otherwise | ||
##' * `message` - string detailing reason why cancellation failed | ||
##' | ||
##' @export | ||
orderly_cancel_remote <- function(keys, root = NULL, locate = TRUE, | ||
remote = NULL) { | ||
remote <- get_remote(remote, orderly_config(root, locate)) | ||
out <- lapply(keys, remote$kill) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you don't want to make this part of the "implements remote" thing, fall back here:
that's probably the tidy thing to do as we don't want to implement this for the path remote There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you don't want to make this part of the "implements remote" thing, fall back here:
that's probably the tidy thing to do as we don't want to implement this for the path remote |
||
names(out) <- keys | ||
out | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be
orderly_remote_cancel
to mirrororderly_remote_status
or stayorderly_cancel_remote
to mirrororderly_run_remote
? Naming things is hardThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have more functions which are
orderly_x_remote
, though they do tend to be when there is a local equivalent - which there isn't here. I thinkorderly_cancel_remote
feels more natural wording to me so I am happy to stick with that, I don't mind switching it over if you prefer though