Skip to content
Snippets Groups Projects
Unverified Commit 3516cf71 authored by Todor Kondic's avatar Todor Kondic
Browse files

api: Fix obtaining values from futures

* R/api.R(extr_data): tmp is now a list of future values, not futures.
parent 715b24dd
No related branches found
No related tags found
No related merge requests found
......@@ -278,7 +278,24 @@ extr_data <- function(m) {
x
})
m$extr$ms <- data.table::rbindlist(tmp)
msk <- sapply(tmp,future::resolved)
curr_done <- which(msk)
names(msk) <- files
for (x in curr_done) {
message("Done extraction for ", names(msk)[[x]])
}
while (!all(msk)) {
msk <- sapply(tmp,future::resolved)
newly_done <- which(msk)
for (x in setdiff(newly_done,curr_done)) {
message("Done extraction for ", names(msk)[[x]])
}
Sys.sleep(0.5)
curr_done <- newly_done
}
m$extr$ms <- data.table::rbindlist(lapply(tmp,future::value))
## m$extr$ms2 <- data.table::rbindlist(lapply(m$extr$tmp, function (e) e$ms2))
message('Saving extracted date to ', m$extr$fn)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment