Commit 3188d718 authored by Dan Baston's avatar Dan Baston

Recover after leaky bucket files interrupted in download

Fixes error where download would not recover if file did not contain
data for an integer number of months.
parent d17b1962
Pipeline #66629321 canceled with stages
in 39 minutes and 22 seconds
......@@ -83,7 +83,7 @@ seek_to_month <- function(fh, init_yearmon, yearmon, nx, ny) {
#' @param nx number of columns in each grid
#' @param ny number of rows in each grid
get_last_month <- function(filename, init_yearmon, nx, ny) {
n_months <- file.size(filename) / grid_size_with_padding(nx, ny)
n_months <- floor(file.size(filename) / grid_size_with_padding(nx, ny))
year <- as.integer(substr(init_yearmon, 1, 4))
month <- as.integer(substr(init_yearmon, 5, 6)) + (n_months - 1)
......
Markdown is supported
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