Skip to content

Commit

Permalink
Try a ten minute time out for BOM's FTP Server
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Jun 7, 2024
1 parent 6a06545 commit ea095ae
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/find_forecast_towns.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ find_forecast_towns <-

file_dbf <- file.path(tempdir(), "AAC_codes.dbf")

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

on.exit(unlink(file_dbf))
Expand Down
2 changes: 1 addition & 1 deletion R/get_bom_metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @noRd

.get_bom_metadata <- function() {
op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

file_in <- file.path(tempdir(), "stations.txt")
Expand Down
2 changes: 1 addition & 1 deletion R/get_coastal_forecast.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ get_coastal_forecast <- function(state = "AUS") {
#' @autoglobal
.parse_coastal_forecast <- function(xml_url) {

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

# load the XML from ftp
Expand Down
2 changes: 1 addition & 1 deletion R/get_precis_forecast.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ get_precis_forecast <- function(state = "AUS") {

.parse_precis_forecast <- function(xml_url) {

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

# load the XML from ftp
Expand Down
8 changes: 4 additions & 4 deletions R/get_radar_imagery.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

get_available_radar <- function(radar_id = "all") {

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

ftp_base <- "ftp://ftp.bom.gov.au/anon/gen/radar/"
Expand All @@ -50,8 +50,8 @@ get_available_radar <- function(radar_id = "all") {
curl::handle_setopt(
handle = list_files,
TCP_KEEPALIVE = 200000L,
CONNECTTIMEOUT = 480L,
TIMEOUT = 480L,
CONNECTTIMEOUT = 600L,
TIMEOUT = 600L,
ftp_use_epsv = TRUE,
dirlistonly = TRUE
)
Expand Down Expand Up @@ -168,7 +168,7 @@ get_radar_imagery <- get_radar <-
)
}

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

ftp_base <- "ftp://ftp.bom.gov.au/anon/gen/radar"
Expand Down
6 changes: 3 additions & 3 deletions R/get_satellite_imagery.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ get_satellite_imagery <- get_satellite <-
stop("{weatherOz} only supports working with one Product ID at a time\n")
}

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

ftp_base <- "ftp://ftp.bom.gov.au/anon/gen/gms/"
Expand Down Expand Up @@ -277,8 +277,8 @@ get_satellite_imagery <- get_satellite <-
curl::handle_setopt(
handle = list_files,
TCP_KEEPALIVE = 60L,
CONNECTTIMEOUT = 480L,
TIMEOUT = 480L,
CONNECTTIMEOUT = 600L,
TIMEOUT = 600L,
ftp_use_epsv = TRUE,
dirlistonly = TRUE
)
Expand Down
2 changes: 1 addition & 1 deletion R/internal_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@

.get_url <- function(remote_file) {

op <- options(timeout = 480L)
op <- options(timeout = 600L)
on.exit(options(op))

bom_file <- file.path(tempdir(), "BOM_file.xml")
Expand Down

0 comments on commit ea095ae

Please sign in to comment.