mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 14:23:38 +00:00
grabar la duración
This commit is contained in:
parent
f96c7aff7d
commit
83b9325d0c
1 changed files with 5 additions and 3 deletions
|
@ -19,9 +19,12 @@ class UriCollectionJob < PeriodicJob
|
||||||
def perform(site_id:, once: true)
|
def perform(site_id:, once: true)
|
||||||
@site = Site.find site_id
|
@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|
|
hostnames.each do |hostname|
|
||||||
uris.each do |uri|
|
uris.each do |uri|
|
||||||
return if stop?
|
next if stop?
|
||||||
|
|
||||||
AccessLog.where(host: hostname, uri: uri)
|
AccessLog.where(host: hostname, uri: uri)
|
||||||
.where('created_at >= ?', beginning_of_interval)
|
.where('created_at >= ?', beginning_of_interval)
|
||||||
|
@ -46,8 +49,7 @@ class UriCollectionJob < PeriodicJob
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Recordar la última vez que se corrió la tarea
|
stat.touch
|
||||||
site.stats.create! name: STAT_NAME
|
|
||||||
|
|
||||||
run_again! unless once
|
run_again! unless once
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue