5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 10:31:41 +00:00

procesar uris a demanda

This commit is contained in:
f 2021-10-20 13:08:21 -03:00
parent 849ee4491c
commit 9cf7c62861

View file

@ -0,0 +1,17 @@
# frozen_string_literal: true
# Procesar una lista de URIs para una lista de dominios. Esto nos
# permite procesar estadísticas a demanada.
class UriCollectionJob < ApplicationJob
def perform(hostnames:, file:)
uris = File.read(file).split("\n")
hostnames.each do |hostname|
uris.each do |uri|
break if File.exist? Rails.root.join('tmp', 'uri_collection_job_stop')
AccessLog.where(host: hostname, uri: uri).completed_requests.non_robots.group(:host, :uri).rollup('host|uri', interval: 'day')
end
end
end
end