Commit cb033589 authored by Laura A DeCicco's avatar Laura A DeCicco Committed by GitHub
Browse files

Merge pull request #259 from ldecicco-USGS/master

retry?
parents f3905a97 8baad2ac
......@@ -59,6 +59,7 @@ importFrom(dplyr,rbind_all)
importFrom(dplyr,select_)
importFrom(httr,GET)
importFrom(httr,HEAD)
importFrom(httr,RETRY)
importFrom(httr,content)
importFrom(httr,headers)
importFrom(httr,status_code)
......
......@@ -6,6 +6,7 @@
#' @param obs_url character containing the url for the retrieval
#' @param \dots information to pass to header request
#' @importFrom httr GET
#' @importFrom httr RETRY
#' @importFrom httr user_agent
#' @importFrom httr stop_for_status
#' @importFrom httr status_code
......@@ -26,7 +27,7 @@
#' }
getWebServiceData <- function(obs_url, ...){
returnedList <- GET(obs_url, ..., user_agent(default_ua()))
returnedList <- RETRY("GET",obs_url, ..., user_agent(default_ua()))
if(status_code(returnedList) != 200){
message("For: ", obs_url,"\n")
......
......@@ -119,8 +119,10 @@ importRDB1 <- function(obs_url, asDateTime=TRUE, convertType = TRUE, tz=""){
#defaults to time in seconds in readr 0.2.2.9??
if(length(grep("hms",lapply(readr.data, class))) > 0){
colHMS <- grep("hms",lapply(readr.data, class))
colList <- list(rep("c", length(colHMS)))
colList <- as.list(rep("c",length(colHMS)))
names(colList) <- paste0("X",colHMS)
readr.data <- suppressWarnings(read_delim(doc, skip = (meta.rows+2),delim="\t",
col_names = FALSE,
col_types = colList))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment