From e8300364d1e49e1b5877512f8695fda955e44da3 Mon Sep 17 00:00:00 2001 From: f Date: Sat, 30 Apr 2022 19:11:57 -0300 Subject: [PATCH] pasar todas las uris a la base de datos --- app/jobs/uri_collection_job.rb | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/app/jobs/uri_collection_job.rb b/app/jobs/uri_collection_job.rb index c3e48ecd..90789aba 100644 --- a/app/jobs/uri_collection_job.rb +++ b/app/jobs/uri_collection_job.rb @@ -45,25 +45,21 @@ class UriCollectionJob < PeriodicJob # que indican las páginas y recursos descargables, el resto son # imágenes, CSS, JS y tipografías que no nos aportan números # significativos. - uris.each do |uri| - break if stop? + name = 'host|uri' + dimensions = { host: host, uri: uris } - name = 'host|uri' - dimensions = { host: host, uri: uri } + rollup(name, beginning, **dimensions) + reduce_rollup(name, beginning, :sum, **dimensions) - rollup(name, beginning, **dimensions) - reduce_rollup(name, beginning, :sum, **dimensions) + columns.each_pair do |column, values| + # Obtener orígenes de visitas por host + values.each do |value| + column_name = "host|uri|#{column}" + column_dimensions = { host: host, uri: uris } + column_dimensions[column] = value - columns.each_pair do |column, values| - # Obtener orígenes de visitas por host - values.each do |value| - column_name = "host|uri|#{column}" - column_dimensions = { host: host, uri: uri } - column_dimensions[column] = value - - rollup(column_name, beginning, **column_dimensions) - reduce_rollup(column_name, beginning, :sum, **column_dimensions) - end + rollup(column_name, beginning, **column_dimensions) + reduce_rollup(column_name, beginning, :sum, **column_dimensions) end end