5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 10:56:22 +00:00

Merge branch 'blazer' into panel.sutty.nl

This commit is contained in:
f 2022-04-23 18:06:39 -03:00
commit 03322e0636
3 changed files with 16 additions and 17 deletions

View file

@ -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)

View file

@ -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

View file

@ -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'