diff --git a/Gemfile.lock b/Gemfile.lock index a66f6c3a..c23340ba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,15 +6,6 @@ GIT rails (>= 3.0) rake (>= 0.8.7) -GIT - remote: https://github.com/ankane/rollup.git - revision: 0ab6c603450175eb1004f7793e86486943cb9f72 - branch: master - specs: - rollups (0.1.3) - activesupport (>= 5.1) - groupdate (>= 5.2) - GIT remote: https://github.com/fauno/email_address revision: 536b51f7071b68a55140c0c1726b4cd401d1c04d @@ -24,6 +15,15 @@ GIT netaddr (>= 2.0.4, < 3) simpleidn +GIT + remote: https://github.com/fauno/rollup.git + revision: ddbb345aa57e63b4cfdf7557267efa89ba60caac + branch: update + specs: + rollups (0.1.3) + activesupport (>= 5.1) + groupdate (>= 5.2) + GEM remote: https://gems.sutty.nl/ specs: @@ -243,8 +243,8 @@ GEM ffi (~> 1.0) globalid (0.6.0) activesupport (>= 5.0) - groupdate (5.2.2) - activesupport (>= 5) + groupdate (6.1.0) + activesupport (>= 5.2) hairtrigger (0.2.24) activerecord (>= 5.0, < 7) ruby2ruby (~> 2.4) diff --git a/app/jobs/uri_collection_job.rb b/app/jobs/uri_collection_job.rb index b66a804d..7ca9a4d9 100644 --- a/app/jobs/uri_collection_job.rb +++ b/app/jobs/uri_collection_job.rb @@ -19,9 +19,12 @@ class UriCollectionJob < PeriodicJob def perform(site_id:, once: true) @site = Site.find site_id + # Recordar la última vez que se corrió la tarea + stat = site.stats.create! name: STAT_NAME + hostnames.each do |hostname| uris.each do |uri| - return if stop? + next if stop? AccessLog.where(host: hostname, uri: uri) .where('created_at >= ?', beginning_of_interval) @@ -46,8 +49,7 @@ class UriCollectionJob < PeriodicJob end end - # Recordar la última vez que se corrió la tarea - site.stats.create! name: STAT_NAME + stat.touch run_again! unless once end diff --git a/config/routes.rb b/config/routes.rb index 4945d108..a132135a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -36,9 +36,6 @@ Rails.application.routes.draw do match '/api/v3/projects/:site_id/notices' => 'api/v1/notices#create', via: %i[post] resources :sites, constraints: { site_id: %r{[^/]+}, id: %r{[^/]+} } do - # Usar Blazer para mostrar estadísticas - mount Blazer::Engine, at: 'stats', as: 'stats' - # Gestionar actualizaciones del sitio get 'pull', to: 'sites#fetch' post 'pull', to: 'sites#merge'