elasticizer: Added 900s timeout after every batch of 200000 articles when updating, to allow ES to do some segment merges (and clean up disk space)

master DKJunk
Erik de Vries 6 years ago
parent a5ba00146f
commit 4ad5357e15

@ -64,6 +64,9 @@ elasticizer <- function(query, src = T, index = 'maml', es_pwd = .rs.askForPassw
if (length(update) > 0){ if (length(update) > 0){
out <- jsonlite:::flatten(json$hits$hits) out <- jsonlite:::flatten(json$hits$hits)
update(out, localhost = localhost, ...) update(out, localhost = localhost, ...)
if (batch%%200 == 0) {
Sys.sleep(900)
}
} else { } else {
out <- bind_rows(out, jsonlite:::flatten(json$hits$hits)) out <- bind_rows(out, jsonlite:::flatten(json$hits$hits))
} }

Loading…
Cancel
Save