Skip to content

Commit

Permalink
Update batch.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace authored Nov 7, 2024
1 parent 003460e commit b8bb8f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ batch_control = function(base_url = "https://api.cyclestreets.net/v2/batchroutes
username = username,
password = Sys.getenv("CYCLESTREETS_PW")
)
httr::POST(url = batch_url, body = body)
httr::POST(url = batch_url, body = body, httr::timeout(600))
}

batch_jobdata = function(
Expand All @@ -358,7 +358,7 @@ batch_jobdata = function(
)
# TODO add polling
if(!silent) message("Sending data, wait...")
res = httr::POST(url = batch_url, body = body)
res = httr::POST(url = batch_url, body = body, httr::timeout(600))
res_json = httr::content(res, "parsed")
error_message = paste0(" ", as.character(res_json$error))
# Print message if silent = FALSE
Expand Down Expand Up @@ -410,7 +410,7 @@ batch_deletejob = function(
)
# TODO add polling
if(!silent) message("Deleting the data")
res = httr::POST(url = batch_url, body = body)
res = httr::POST(url = batch_url, body = body, httr::timeout(600))
res_json = httr::content(res, "parsed")
message("Job ",paste0(res_json, collapse = ": "))
}
Expand Down

0 comments on commit b8bb8f0

Please sign in to comment.