Skip to content

Commit

Permalink
tasks() and taskLog() are only for shinyapps.io and posit.cloud
Browse files Browse the repository at this point in the history
trim listTasks() and killTask() from the Connect client - non-APIs
trim getTask() from the Connect client - waitForTask is used
  • Loading branch information
aronatkins committed Jun 26, 2024
1 parent d0a0a22 commit 7fc25af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
17 changes: 0 additions & 17 deletions R/client-connect.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,23 +102,6 @@ connectClient <- function(service, authInfo) {
GET(service, authInfo, paste0("/applications/", applicationId))
},

## Tasks API

listTasks = function() {
path <- "/tasks"
GET(service, authInfo, path)
},

getTask = function(taskId) {
path <- file.path("/tasks", taskId)
GET(service, authInfo, path)
},

killTask = function(taskId) {
path <- file.path("/tasks", taskId, "kill")
POST_JSON(service, authInfo, path, list())
},

waitForTask = function(taskId, quiet = FALSE) {
start <- 0
while (TRUE) {
Expand Down
6 changes: 6 additions & 0 deletions R/tasks.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
#'
#' }
#' @seealso [taskLog()]
#' @note This function works only with shinyapps.io and posit.cloud.
#' @export
tasks <- function(account = NULL, server = NULL) {

# resolve account and create connect client
accountDetails <- accountInfo(account, server)
checkCloudServer(accountDetails$server)

client <- clientForAccount(accountDetails)

# list tasks
Expand Down Expand Up @@ -55,10 +58,13 @@ tasks <- function(account = NULL, server = NULL) {
#'
#' }
#' @seealso [tasks()]
#' @note This function works only with shinyapps.io and posit.cloud.
#' @export
taskLog <- function(taskId, account = NULL, server = NULL, output = NULL) {

accountDetails <- accountInfo(account, server)
checkCloudServer(accountDetails$server)

client <- clientForAccount(accountDetails)

if (identical(output, "stderr")) {
Expand Down
3 changes: 3 additions & 0 deletions man/taskLog.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/tasks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7fc25af

Please sign in to comment.