actor_aggregation: added randomized short sleep, to allow for parallel execution

master
Erik de Vries 5 years ago
parent e3b26c0be3
commit 58fce4d560

@ -64,7 +64,7 @@ actor_aggregation <- function(row, actors, es_pwd, localhost, default_operator =
} else { } else {
query <- paste0('computerCodes.actors:(',paste(actorids, collapse = ' '),') && publication_date:[',actor$`_source.startDate`,' TO ',actor$`_source.endDate`,']') query <- paste0('computerCodes.actors:(',paste(actorids, collapse = ' '),') && publication_date:[',actor$`_source.startDate`,' TO ',actor$`_source.endDate`,']')
} }
Sys.sleep(runif(1,0.1,0.3))
out <- elasticizer(query_string(paste0('country:',actor$`_source.country`,' && ',query), out <- elasticizer(query_string(paste0('country:',actor$`_source.country`,' && ',query),
fields = c('computerCodes.actorsDetail', 'doctype', 'publication_date'), default_operator = default_operator), fields = c('computerCodes.actorsDetail', 'doctype', 'publication_date'), default_operator = default_operator),
localhost = localhost, localhost = localhost,

Loading…
Cancel
Save